试图在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
});
...
}
我是不是遗漏了什么?
通过修改以下内容解决了这个问题 <base href="/">
到 <base href="./">
在index.html中