Internet Explorer 10/11和旧的.net Framework 1.1网站的兼容性问题 [英] Compatibility problems with Internet Explorer 10/11 and an old .net framework 1.1 website
问题描述
场景
我在.net(框架1.1)中开发了一个非常老的网站.该站点在Internet Explorer 10/11中存在一些问题,可以使用兼容性视图解决该问题.
I have a very old website developed in .net (framework 1.1). The site has several problems with Internet Explorer 10/11 that can be fixed using compatibility view.
问题
问题在于,框架1.1无法将Internet Explorer 10/11识别为高级功能浏览器,因此当具有Internet Explorer 10/11的用户访问网站时,许多功能(例如javascript代码)将被禁用.
Problem is that framework 1.1 doesn't recognize Internet Explorer 10/11 as an advanced capability browser, so a lot of features (for example javascript code) are disabled when a user with Internet Explorer 10/11 accesses the website.
Microsoft发布了补丁程序来解决此问题,该问题适用于.net Framework版本> = 2.0,但不适用于Framework 1.1.
Microsoft released patches to fix this problem for .net framework versions >=2.0 but not for framework 1.1.
我已经尝试过的东西
-
我尝试在web.config中强制IE7兼容模式,或者在IIS中或直接在html页面内部添加HTTP标头,
I tried forcing IE7 Compatibility Mode in web.config or adding HTTP Header in IIS or directly inside html pages with:
<meta http-equiv="X-UA-Compatible" content="IE=7" />
但这不是有效的解决方案,因为由于1.1框架问题,仍然缺少javascript代码.
but this is not a valid solution, since javascript code is still missing due to the 1.1 framework issue.
我找到的唯一可行的解决方案是在浏览器中手动设置Compatibility View,但是我的一些客户在激活Compatibility View时遇到了问题,因为他们对PC没有信心.
The only working solution I found is manually setting Compatibility View in the browser, but some of my customers have problems activating Compatibility View since they don't have confidence with PCs.
我的两分钱
我知道最好的解决方案可能是将整个项目转换为框架的较新版本(> = 2.0),不幸的是,该项目庞大且转换非常复杂(该解决方案包括很多其他解决方案项目,较旧的经典ASP部分,Crystal Reports报表等...)
I know that probably the best solution would be to convert the entire project to a newer version of the framework (>=2.0), unfortunately the project is huge and its conversion would be very complex (the solution includes a lot of other projects, older classic ASP sections, Crystal Reports reports and so on...)
真正的问题
是否有不需要最终用户进行项目转换或手动操作的解决方案?
推荐答案
我设法找到一个解决方案:基本上,我将应用程序重新定位为在Framework 4.0下运行,而该应用程序仍是使用Framework 1.1编译的.
I managed to find a solution: basically I retarget my application to run under Framework 4.0 while the application is still compiled with Framework 1.1.
为此,我遵循了此 MSDN页面.这是摘录:
To accomplish this I followed this MSDN page. Here's an excerpt:
您可以将应用程序重新定位为在.NET Framework 4下运行.重新定位需要在应用程序的配置文件中添加一个元素,以使其可以在.NET Framework 4下运行.这种配置文件采用以下形式:>
<configuration>
<startup>
<supportedRuntime version="v4.0"/>
</startup>
</configuration>
所以我的问题可以通过两个步骤解决:
So my problem is solved in 2 steps:
-
将此部分添加到Framework 1.1 Web应用程序的web.config文件中:
add this section to the web.config file of the Framework 1.1 web application:
<configuration>
<startup>
<supportedRuntime version="v4.0"/>
</startup>
</configuration>
现在该应用程序在Framework 4.0下运行,因此可以正确识别新的浏览器并提供高级功能.
Now the application runs under Framework 4.0 therefore new browsers are correctly recognized and advanced features are available.
这篇关于Internet Explorer 10/11和旧的.net Framework 1.1网站的兼容性问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!