尝试将其添加到您的web.config
sytem.webserver设置中。
<system.webServer> <modules runAllManagedModulesForAllRequests="true"/><system.webServer>
编辑 :
尝试更改RouteConfig.cs,如下所示:
routes.MapRoute( name: "Default", url: "app/{*.}", defaults: new { controller = "Ng", action = "Index" } );编辑2:
我已经完全放弃了这个问题,但是现在我才意识到也许问题是您尚未将IIS服务器配置为可与Html5Mode一起使用,请查看以下内容:https : //github.com/angular-ui/ ui-router / wiki
/常见问题解答#如何配置您的服务器以使用html5mode
具体来说这部分:
Azure IIS重写:
<system.webServer> <rewrite> <rules> <rule name="Main Rule" stopProcessing="true"> <match url=".*" /> <conditions logicalGrouping="MatchAll"> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> </conditions> <action type="Rewrite" url="/" /> </rule> </rules> </rewrite></system.webServer>我希望这个对你有用。



