繁体   English   中英

Web.config中的奇怪警告

[英]Strange warnings in Web.config

一张图片值1000字,所以这里有几张图片(忽略我的编辑):

警告1

警告2

警告3

我在此解决方案中的任何项目中都没有引用或使用Entity Framework。 在我安装了一堆Windows更新后,这种情况刚刚开始发生。 共有九个警告。 我正在运行Windows 8.1 Pro,但我不知道这是否重要。 我在同一解决方案中有其他项目,具有相同的项目类型和.NET框架版本。 该项目本身似乎在IIS中运行良好。 我的所有Web.config文件都具有类似的配置和结构。 这是有问题的(更多编辑):

<?xml version="1.0"?>
<configuration>
    <configSections>
        ...
    </configSections>
    ...
    <connectionStrings>
        ...
    </connectionStrings>
    <system.web>
        <compilation debug="true" targetFramework="4.5.1"/>
        <authentication mode="None"/>
        <sessionState mode="Off"/>
        <customErrors mode="RemoteOnly"/>
        <httpRuntime enableHeaderChecking="false" enableVersionHeader="false" requestValidationMode="2.0" sendCacheControlHeader="false" targetFramework="4.5.1"/>
    </system.web>
    <system.webServer>
        <httpErrors existingResponse="PassThrough"/>
        <validation validateIntegratedModeConfiguration="true"/>
        <handlers>
            <remove name="ExtensionlessUrlHandler-Integrated-4.0"/>
            <remove name="OPTIONSVerbHandler"/>
            <remove name="TRACEVerbHandler"/>
            <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0"/>
        </handlers>
        <staticContent>
            <clientCache cacheControlMode="UseMaxAge" httpExpires="7.00:00:00"/>
        </staticContent>
        <urlCompression doStaticCompression="true" doDynamicCompression="true" dynamicCompressionBeforeCache="true"/>
        <defaultDocument>
            <files>
                <clear/>
            </files>
        </defaultDocument>
    </system.webServer>
    <system.runtime.caching>
        <memoryCache>
            <namedCaches>
                ...
            </namedCaches>
        </memoryCache>
    </system.runtime.caching>
    <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <dependentAssembly>
                <assemblyIdentity name="Microsoft.Data.OData" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
                <bindingRedirect oldVersion="0.0.0.0-5.6.0.0" newVersion="5.6.0.0"/>
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="Microsoft.Data.Edm" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
                <bindingRedirect oldVersion="0.0.0.0-5.6.0.0" newVersion="5.6.0.0"/>
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="Microsoft.ServiceBus" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
                <bindingRedirect oldVersion="0.0.0.0-2.2.0.0" newVersion="2.2.0.0"/>
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="System.Spatial" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
                <bindingRedirect oldVersion="0.0.0.0-5.6.0.0" newVersion="5.6.0.0"/>
            </dependentAssembly>
        </assemblyBinding>
    </runtime>
</configuration>

我仍然不确定如何,但我设法通过删除Web.config及其转换并重新创建它来“修复”该问题。 之后我做了一个差异,并没有看到任何可能导致此类警告的差异。 我想我可以把它归结为某种奇怪的缓存问题。

在Visual Studio 2017中搜索类似问题的解决方案时,我发现了这个老问题。接受的答案让我走上正轨。 这必须是缓存问题。 一个搜索更多 - 这是一个intellisense缓存问题。

Rick Strahl有一篇非常好的文章

通过从解决方案中删除.vs文件夹解决了我的问题。 .vs文件夹是随Visual Studio 2015引入的。所以这不是这个问题的直接答案,而是对未来访问者的一个提示。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM