Asp.net mvc 如何在IIS7上使用WebDAV上载web.config文件?

Asp.net mvc 如何在IIS7上使用WebDAV上载web.config文件?,asp.net-mvc,iis,web-config,webdav,Asp.net Mvc,Iis,Web Config,Webdav,我想使用WebDAV将ASP.NET MVC网站复制到远程IIS 7服务器。我在IIS中创建了一个站点,启用了WebDAV,并分配了一个名为“WebDAV应用程序池”的特殊应用程序池。使用Windows7或Vista客户端,我可以将远程站点装载为网络驱动器。到目前为止,一切顺利 但是,我无法将web.config文件上载到远程站点。一个问题是,一旦上传了web.config,它就被用来配置WebDAV站点。MVC项目的Views文件夹中的web.config文件有效地阻止了对该文件夹的访问 为了

我想使用WebDAV将ASP.NET MVC网站复制到远程IIS 7服务器。我在IIS中创建了一个站点,启用了WebDAV,并分配了一个名为“WebDAV应用程序池”的特殊应用程序池。使用Windows7或Vista客户端,我可以将远程站点装载为网络驱动器。到目前为止,一切顺利

但是,我无法将
web.config
文件上载到远程站点。一个问题是,一旦上传了
web.config
,它就被用来配置WebDAV站点。MVC项目的
Views
文件夹中的
web.config
文件有效地阻止了对该文件夹的访问

为了解决这个问题,我在
applicationHost.config
文件中配置了应用程序池:

<configuration>
  <applicationPools>
    <add name="WebDAV Application Pool"
       autoStart="true"
       enableConfigurationOverride="false" />
  </applicationPools>
</configuration>
特别是
hiddenSegments
通常会阻止对
web.config
的访问,但将
applyToWebDAV
属性设置为false应确保在使用WebDAV时不会阻止此文件

不幸的是,我仍然无法将我的
web.config
文件复制到站点的根文件夹中。在Windows资源管理器中拖放到映射的WebDAV网络驱动器将导致以下错误消息:

错误0x80070057:参数不正确

在连线上,HTTP状态
400错误请求
似乎被返回

为了避免这个问题,我可以在IIS 7上配置WebDAV吗


改善效果追踪 目前,我无法重现上述问题。也许我必须重新启动一些东西,或者其他未知因素修复了我的问题。底线是我现在可以使用WebDAV发布网站。

1)打开
%windir%\system32\inetsrv\config\schema\WebDAV\u schema

2) 在
configSchema
部分中添加以下内容

<sectionSchema name="system.codedom">
  <element name="compilers">
    <collection addElement="compiler" removeElement="remove" clearElement"clear">
      <attribute name="language" type="string" isCombinedKey="true"/>
      <attribute name="extension" type="string" isCombinedKey="true"/>
      <attribute name="type" type="string"/>
      <attribute name="warningLevel" type="int"/>
      <collection addElement="providerOption">
        <attribute name="name" type="string" isUniqueKey="true"/>
        <attribute name="value" type="string"/>
      </collection>
    </collection>
  </element>
</sectionSchema>


很抱歉它是一个图像,但由于某种原因,如果我将其粘贴到其中,编辑器会剥离xml。修改模式的目的是什么?无论如何,我的问题似乎消失了。这里有一点无效的XML,太小了,无法编辑。clearElement“clear”应该是clearElement=“clear”。您关于启用配置覆盖的内容非常宝贵。我不敢相信这不是一个可以从任何地方的GUI访问的设置。
<sectionSchema name="system.codedom">
  <element name="compilers">
    <collection addElement="compiler" removeElement="remove" clearElement"clear">
      <attribute name="language" type="string" isCombinedKey="true"/>
      <attribute name="extension" type="string" isCombinedKey="true"/>
      <attribute name="type" type="string"/>
      <attribute name="warningLevel" type="int"/>
      <collection addElement="providerOption">
        <attribute name="name" type="string" isUniqueKey="true"/>
        <attribute name="value" type="string"/>
      </collection>
    </collection>
  </element>
</sectionSchema>