Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
由于providerOptions元素,发布ASP.NET 3.5网站会使Web.config为空_Asp.net_Iis 7.5_Asp.net 3.5_Publishing Site - Fatal编程技术网

由于providerOptions元素,发布ASP.NET 3.5网站会使Web.config为空

由于providerOptions元素,发布ASP.NET 3.5网站会使Web.config为空,asp.net,iis-7.5,asp.net-3.5,publishing-site,Asp.net,Iis 7.5,Asp.net 3.5,Publishing Site,我正在尝试使用WebDAV将ASP.NET3.5站点发布到IIS7.5服务器,每次执行此操作时,配置文件都会变为空。罪魁祸首是下面代码中的providerOption elemet <system.codedom> <compilers> <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, Sys

我正在尝试使用WebDAV将ASP.NET3.5站点发布到IIS7.5服务器,每次执行此操作时,配置文件都会变为空。罪魁祸首是下面代码中的providerOption elemet

<system.codedom>
<compilers>
  <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <providerOption name="CompilerVersion" value="v3.5"/>
    <providerOption name="WarnAsError" value="false"/>
  </compiler>
  <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <providerOption name="CompilerVersion" value="v3.5"/>
    <providerOption name="OptionInfer" value="true"/>
    <providerOption name="WarnAsError" value="false"/>
  </compiler>
</compilers>

位于C:\Windows\System32\inetsrv\config\schema的FX_schema.xml文件用于验证网站的Web.config,其中不包含作为xml一部分的providerOptions。我可以添加一些允许的内容,通过添加如下内容修改文件以允许:

 <collection addElement = "providerOption">
  <attribute name = "name" required = "true" isUniqueKey = "true" type = "string" />
  <attribute name = "value" required = "true" type = "string" />
 </collection>

但是我没有写入模式文件的任何权限。这看起来也是其他人应该看到的,快速搜索发现一些人看到了。我看到的唯一选择是“只删除codedom部分”,这意味着3.5版本的东西,比如LINQ,将无法工作,因此这是一个非初学者


那么,我如何将我的网站发布到IIS 7.5,同时保持providerOption元素的完整性呢?

好吧,因为我找不到任何特定的内容,所以我继续做了我认为可能是解决方案的事情:我制作了自己的文件,并将其与模式文件一起放入。我将其命名为Three-Five.xml,并将其放在C:\Windows\System32\inetsrv\config\schema。文件的全部内容如下:

<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" />
                <attribute name="compilerOptions" type="string" />
                <collection addElement="providerOption">
                  <attribute name="name" required="true" isUniqueKey="true" type="string" />
                  <attribute name="value" required="true" type="string" />
                </collection>
            </collection>
        </element>
    </sectionSchema>
</configSchema>

然后,我发布了一个3.5站点,从appconfig设置中检索信息,并执行了一些LINQ以确保配置和3.5有效。配置文件没有被屏蔽,LINQ正在按预期工作,因此我尝试将其称为解决方案