发布ASP.NET 3.5网站的Web.config叶空由于providerOptions元 [英] Publishing ASP.NET 3.5 Site Leaves Web.config Empty Due to providerOptions Element

查看:144
本文介绍了发布ASP.NET 3.5网站的Web.config叶空由于providerOptions元的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想发布一个ASP.Net 3.5网站到IIS 7.5服务器使用WebDAV,每次我做配置文件时卷起空。罪魁祸首是低于code看到的providerOption elemet。

I am trying to publish a ASP.Net 3.5 site to an IIS 7.5 server using WebDAV and each time I do the config file winds up empty. The culprit is the providerOption elemet seen in the code below.

<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 FX_schema.xml文件:\\ WINDOWS \\ SYSTEM32 \\ INETSRV \\设置\\架构被用于验证该网站的Web.config,它不包含providerOptions作为XML存在的一部分。我可以补充一下,以允许通过添加像这样修改文件,以允许它:

The FX_schema.xml file at C:\Windows\System32\inetsrv\config\schema is being used to validate the Web.config for the site and it doesn't contain providerOptions as part of the XML there. I could add something to allow for that modify the file to allow for it by adding something like this:

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

但我没有任何权限写入模式文件。这也看起来像其他人应该看到和快速搜索发现,一些人。我见过的唯一选项是只删除codeDOM节,这意味着3.5的东西,比如LINQ,不会工作,所以这是一个非首发。

But I don't have any permissions to write to the schema file. This also looks like something others should be seeing and a quick search found some people are. The only option I have seen is "Just delete the codedom section" which means 3.5 things, like LINQ, will not work so that is a non-starter.

那么,如何发布我的网站到IIS 7.5与providerOption要素是否完整?

So how do I publish my Web Site to IIS 7.5 with the providerOption elements intact?

推荐答案

好了,因为我无法找到具体的我只是一往直前,并做了我认为可能是解决什么:我做我自己的文件并把它放在与架构文件。我把它称为发明名称ThreeFive.xml,并把它放在C:\\ WINDOWS \\ SYSTEM32 \\ INETSRV \\设置\\架构。是该文件的全部内容如下:

Well, since I couldn't find anything specific I just went ahead and did what I thought might be the solution: I made my own file and placed it in with the schema files. I called it the inventive name ThreeFive.xml and placed it at C:\Windows\System32\inetsrv\config\schema. The entire contents of the file are as follows:

<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>

然后我出版了从AppConfig中设置检索到的信息,并做了一些LINQ以确保配置了3.5点和3.5都有效。该配置文件没有空白和LINQ按预期工作,所以我很想把这个解决方案。

I then published a 3.5 site that retrieved information from an appconfig setting and did some LINQ to make sure the config and the 3.5 were in effect. The config file was not blanked and the LINQ is working as expected so I am tempted to call this a solution.

这篇关于发布ASP.NET 3.5网站的Web.config叶空由于providerOptions元的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆