.net - iexplore.exe.config 被忽略

标签 .net internet-explorer app-config

我需要覆盖 Internet Explorer 中托管的 .NET 组件的一些设置。我创建了一个 iexplore.exe.config 文件并将它放在 c:\program files\internet explorer 中。

下面是配置文件:

<configuration>
    <system.net>
        <webRequestModules>
            <remove prefix="http:"/>
            <remove prefix="https:"/>
            <add prefix="http:" type="MyHttpRequestCreator, MyRequestModule, Version=1.0.0.0, Culture=neutral, PublicKeyToken=bee8bd1bab54ad99" />
            <add prefix="https:" type="MyHttpRequestCreator, MyRequestModule, Version=1.0.0.0, Culture=neutral, PublicKeyToken=bee8bd1bab54ad99" />
        </webRequestModules>
    </system.net>   
</configuration> 

不幸的是,这似乎被 IE 完全忽略了。即使我在文件中放入无效文本,也不会记录任何错误。

如果我将它添加到 machine.config 中,同样的配置可以完美运行,但如果可能的话,我想将我的覆盖限制为 IE。

我尝试启用 IEHostLogFile(参见:http://support.microsoft.com/kb/313892),这给了我一些有趣的条目。它表明正在加载远程配置文件:
Microsoft.IE.SecureFactory: Added configuration file: DotNetConfig.xml
Microsoft.IE.SecureFactory: Application base: http://someserver/dotnet/
Microsoft.IE.SecureFactory: Private Bin Path: bin
Microsoft.IE.IDKey: Created key
Microsoft.IE.SecureFactory: Trying to create instance of type http://someserver/dotnet/
SomeApp.DLL#SomeApp.SomeClass
...

我检查了那个配置文件,它没有覆盖 system.net 部分,所以我应该仍然能够提供我的覆盖。我可以尝试修改该文件,但此解决方案对我不起作用,因为我不希望使用此应用程序的每个人都受到影响,只是特定的机器受到影响。

想法?

最佳答案

当您将以下内容放入您的主机网站时,可能会有所帮助:

<link rel="Configuration" href="your.config"/>

查看以下链接。你已经很老了,但也许这并没有改变:

http://msdn.microsoft.com/en-us/library/aa719757(vs.71).aspx

如果这解决了问题,您可以考虑如何仅将其包含在某些机器上。

关于.net - iexplore.exe.config 被忽略,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9314883/

相关文章:

.net - "Could not create SSL/TLS secure channel"即使 SCHANNEL 报告 "An SSL server handshake completed successfully."

c# - 如何区分用户点击链接和页面自动重定向?

javascript - 为 XMLHttpRequest 设置 referer?

c# - 尝试调用 wcf 服务时出错

internet-explorer - IE8 删除了我的字段集某些部分周围的边框。困惑..适用于 ie6 和 ie7

html - 使用过滤器 :FlipH in IE only 后呈现锯齿状字体

c# - 从 C++ 调用 C# dll 时如何使用 app.config 文件

c# - 以编程方式将 key 添加到 App.config C#

metadata - EF 4.3 与 Firebrid Dot Net Provider

c# - 在一个类中声明静态方法并将其用作另一个类的方法