visual studio 2005 / visual studio 2008 添加函数或变量时当前页面的脚本发生错误

by JesonSara

系统环境:VS2005 + IE8,XP SP3
问题描述:VS2005添加函数时提示 当前页面的脚本发生错误,行:843,char:2,错误:"ParameterType.Value.length'为空或不是对象,代码0。继续运行脚本就提示此网站的某个加载项运行失败,请检查"Internet选项"中的安全设置是否存在潜在冲突。
原因:IE8兼容性问题。据称,VS2008+IE8也存在同样的问题。
解决方案:
1. 推荐方案:安装Internet Explorer 8 for Windows XP 安全更新程序 (KB969897)。该更新同时会解决VS添加向导的问题。
http://www.microsoft.com/downloads/zh-cn/details.aspx?familyid=d9e27ce1-4e7c-437f-9477-e7805a33da08 或者根据系统版本选择合适的补丁:
http://technet.microsoft.com/en-us/security/bulletin/MS09-019 2. 修改注册表:
定位到 HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones
新建项 1000
在该项下,新建DWORD值:
Name = 1207
Type = REG_DWORD
Data = 0x000000



Some VS2005 and VS2008 Wizards Pop Up Script Error.


Visual C++ team has discovered that after installing the current release of Internet Explorer (Internet Explorer 8), some VC++ wizards do not function correctly. The products affected are Visual Studio 2005 and Visual Studio 2008. Following are the affected wizards:



- Add Function



- Add Variable



- Smart Device – New Project Creation



- Smart Device – Add Class




Invoking any of the above wizards in VS2005 or VS2008 will pop up a script error if IE8 is installed on the machine. We have a workaround for those who have encountered this error.



Please follow the following steps:



- Open regedit (on a 64-bit OS, open the 32-bit regedit)



- Under “HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet  


Settings\Zones”, create a new key called 1000 (if it isn't already there)


- Under 1000, create a DWORD entry with:



o Name = 1207



o Type = REG_DWORD



o Data = 0x000000



For the workaround to work on VS2005 however, the VS2005 SP1 (and VS2005 SP1 Update for Windows Vista) has to be installed.


Following is a brief explanation of the problem and the workaround:



The VC++ Wizards Engine implements the IInternetSecurityManager interface. In this implementation it allows or disallows specific actions under certain policies that Internet Explorer queries it about. In IE8 a custom Security Manager now also gets queried about the URLACTION_ACTIVEX_OVERRIDE_REPURPOSEDETECTION policy which IE previously did not delegate to custom security managers when the engine wasn’t running in the iexplore.exe process. The IE engine then fails this action because we don’t have a policy entry for it in the custom zone for VC++ Wizards. We are still investigating whether this change in IE8 is by design and will possibly be addressing it by a fix in either the Wizard or IE components depending on the outcome.



The above workaround lets the policy 1207 (URLACTION_ACTIVEX_OVERRIDE_REPURPOSEDETECTION) to be allowed in zone 1000 (custom zone of VC++ Wizards engine). This allows the wizard code to work as intended.



We apologize for the inconvenience this issue may have caused you.