首页 > 解决方案 > 角度 9 + .net 核心 3 net::ERR_CONNECTION_REFUSED

问题描述

我,尝试编写一个简单的 CRUD 应用程序,并收到错误:net::ERR_CONNECTION_REFUSED 尝试调用服务器:

 getPersons(): Observable<Array<Person>> {

     return this.httpService.get<Array<Person>>(this.serverUrl + '/GetAllPersons',{headers: this.Headers});

Headers: any = { withCredentials: true, responseType: 'json', headers: { 'Content-Type': 'application/json' } };

服务器中的断点不会停止在:

[HttpGet]
        [Route("GetAllPersons")]
        public IEnumerable<Person> GetAllPersons()
        {
            try
            {
                IEnumerable<Person> personArray = this.GetAllRecordsFromDB();
                return personArray;
            }
            catch (Exception)
            {
                throw new Exception();
            }
        }

谢谢

标签: angular.net-coreasp.net-core-3.1

解决方案


推荐阅读