在IIS Web服务器中,无法使用ASP.NET Core运行Angular应用。

问题描述 投票:0回答:0

ClientApp

试图在IIS中发布Angular ASP.NET Core应用程序,但它无法工作,已经尝试了这个解决方案,但无法解决它。部署Angular 6 ASP.NET Core应用程序

已经试过这个了。

public void ConfigureServices(IServiceCollection services)
{            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
    ....
    // In production, the Angular files will be served from this directory
    services.AddSpaStaticFiles(configuration =>
    {
        configuration.RootPath = "ClientApp/dist/ClientApp";//change here
    });

     ...
}

我是不是遗漏了什么?

angular asp.net-core iis
0
投票

通过修改以下内容解决了这个问题 <base href="/"><base href="./"> 在index.html中

© www.soinside.com 2019 - 2024. All rights reserved.