ASP.NET Core Web Api 2.1的默认文件可以工作,但是在IIS 8.5上部署时,控制器返回404

时间:2018-10-30 21:01:30

标签: angular iis asp.net-core asp.net-core-webapi angular7

因此,我将Angular 7应用程序部署到IIS 8.5的实例。为了提供实际的Angular应用程序,我使用UseDefaultFiles()上的Startup.cs方法提供了服务。

        app.UseDefaultFiles();
        app.UseStaticFiles();
        app.UseAuthentication();
        app.UseHttpsRedirection();
        app.UseMvc();

足够公平。 index.html中的实际wwwroot和相关的.js文件可以轻松使用,我的应用程序可以正常工作。然后,我的Angular应用尝试向我的Web API发出请求,然后...

Failed to load resource: the server responded with a status of 404 (Not Found)

在什么情况下甚至会发生这种情况?在我的机器上工作正常。

0 个答案:

没有答案