问题描述
我有一个网页调用.NET程序集。一切工作正常在Windows XP和IE7。相关部分:
I have a web page that calls a .Net assembly. Everything works fine in Windows XP and IE7. The relevant parts:
<html>
<head>
<script language="javascript" type="text/javascript">
function doScript() {
myControl1.Go("value1","value2");
}
</script>
</head>
<body onload="javascript:doScript();">
<object id="myControl1" name="myControl1"
codebase="../cabs/myassembly.dll"
classid="../cabs/myassembly.dll#MyNs.MyClass"
width="1" height="1"></object>
</body>
</html>
我不能让这个在Windows 7工作与IE8。一些注意事项:
I cannot get this to work in Windows 7 with IE8. Some notes:
- 在程序集是强命名。
- 在我的
本地主机
举办这次现在。- 在正在工作(VirtualBox虚拟托管的WinXP,IE7)的机器,它使用一个IP地址,我的本地机器(
HTTP://1.2.3.4 / ...
),而IP是在IE的受信任的站点。 - 在机器不工作(Windows 7的IE8),它是使用
的http://本地主机/ ...
和本地主机
是在IE的受信任的站点。
- The assembly is strong named.
- I am hosting this on
localhost
right now.- On the machine that is working (VirtualBox-hosted WinXP, IE7), it is using an IP address to my local machine (
http://1.2.3.4/...
) and that IP is in the "Trusted Sites" of IE. - On the machine that is not working (Windows 7, IE8), it is using
http://localhost/...
andlocalhost
is in the "Trusted Sites" of IE.
有没有人有任何想法设法得到这个工作,或者解决那里的问题是在哪里?
免责声明:是的,我知道这是2012年,而世界已经改变过去的IE7,IE8和ActiveX等,远的不说,我们是技术落后一点点。这是我的问题来解决;升级到现代的解决方案不会是一个选项。的
更新:我没有得到它在Windows XP的VirtualBox工作运行IE8。因此,它似乎到Windows 7。它在我的本地机和VirtualBox的运行Windows 7的失败,无论问题是具体的,IE8。
UPDATE: I did get it to work in a Windows XP VirtualBox running IE8. So it appears the problem is specific to Windows 7. It fails both on my local machine and a VirtualBox running Windows 7, IE8.
推荐答案
这解决了通过添加注册表项上应答"Loading .NET用户控件在IE与.NET 4.0(即使这是一个2.0控制)
This was solved by adding the registry key answered on "Loading .NET UserControls in IE with .NET 4.0" (even though this was a 2.0 control)
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework] "EnableIEHosting"=dword:00000001
这篇关于调用.NET程序集从IE8 OBJECT标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
- On the machine that is working (VirtualBox-hosted WinXP, IE7), it is using an IP address to my local machine (
- 在正在工作(VirtualBox虚拟托管的WinXP,IE7)的机器,它使用一个IP地址,我的本地机器(