简体   繁体   English

Asp.Net Core Web API + Angular请求不起作用

[英]Asp.Net Core Web API + Angular requests not working

i am developing web application using Angular and Asp.Net Core Web api and i met up following issue: i get 400 error when sending requests. 我正在使用Angular和Asp.Net Core Web API开发Web应用程序,遇到了以下问题:发送请求时出现400错误。 When i run my application using VS and IIS Express everything is ok, but when i deploy my app to IIS and use it directly by ip, the result of request is 400. You could see screenshots in attachment. 当我使用VS和IIS Express运行应用程序时,一切正常,但是当我将应用程序部署到IIS并直接通过ip使用它时,请求的结果为400。您可以在附件中看到屏幕截图。 Also i couldnt get acces directy by my api link, its states that angular router not find any path. 我也无法通过我的api链接直接访问acces,它指出有角路由器找不到任何路径。 Maybe this problem is related with angular routing? 也许这个问题与角度路由有关? And i am using Swagger to interact with api. 我正在使用Swagger与api进行交互。

Visual studio + iis express Visual Studio + IIs Express

在此处输入图片说明

IIS IIS

在此处输入图片说明

My problem was that my iis application pool hadnt rights to access sql database. 我的问题是我的iis应用程序池没有访问sql数据库的权限。 C# were throwing an exception and in browser it was looking like there no related path. C#抛出异常,在浏览器中看起来好像没有相关路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM