找不到等效的system.web.compilation.tempdirectory for system.webserver
在 web.config
中,等于 system.web
> compilation [tempdirectory]
属性,但使用更及最新的 > system.weberver
而不是 system.web
?
这是我需要添加到我的web.config的内容:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<compilation tempDirectory="W:\vhosts\mysite.com\tmp" />
</system.web>
</configuration>
但是,我当前的 web.config
依赖于 system.webserver
,而不是 system.web
并添加属性导致内部服务器错误500。
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<urlCompression doDynamicCompression="true" doStaticCompression="true" dynamicCompressionBeforeCache="true"/>
<rewrite>
<rules>
<rule name="Angular Routes" 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="./index.html" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
编译[tempDirectory]
取决于system.web
,因此您不能在system.webserver
中添加它。但是
system.web
和system.webserver
都可以在web.config中存在。他们不会导致冲突。compilation[tempDirectory]
is depending onsystem.web
, so you cannot add it insystem.webServer
.But
system.web
andsystem.webServer
can both exist in web.config. They won't lead to conflict.