HTTP 错误 500.52 - URL 重写模块错误

HTTP Error 500.52 - URL Rewrite Module Error

URL 路由工作正常,但是当我在 IIS 网站中创建应用程序时,应用程序停止工作并出现错误

HTTP Error 500.52 - URL Rewrite Module

此规则运行良好 (http://abcd/)

<rule name="AngularJS Routes" stopProcessing="false">
          <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>

但是当我更改它时应用程序出现错误 (http://abcd/app/)

<rule name="AngularJS Routes" stopProcessing="false">
          <match url="(^app/.*)" />
          <conditions logicalGrouping="MatchAll">
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />

          </conditions>
          <action type="Rewrite" url="/app/"/>
        </rule>

I have searched on google but found no solution. Expert guides is need.Thanks

您的配置错误显示:

Cannot add duplicate collection entry of type 'rule' with unique key attribute 'name' set to 'AngularJS Routes'

您可能需要更改其中一个 rule 名称才能使其生效,例如:

<rule name="AngularJS Routes" stopProcessing="false">[...]</rule>
<rule name="AngularJS App Routes" stopProcessing="false">[...]</rule>