角9 + .net核心3 net :: ERR_CONNECTION_REFUSED

时间:2020-04-28 21:12:39

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

i,尝试编写一个简单的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();
            }
        }

谢谢

0 个答案:

没有答案