Visual Studio 2010中的旧版安全策略和COM参考 [英] Legacy Security Policy in Visual Studio 2010 and COM References
问题描述
设计时模式下的NetFx40_LegacySecurityPolicy
通过向我的devenv.exe.config添加< NetFx40_LegacySecurityPolicy enabled =true/>
设计师现在可以正常工作,但有些COM参考的解决方案中的项目不再编译,除了:
ResolveComReference任务无法从Microsoft.Build.Tasks.v4.0,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = b03f5f7f11d50a3a中实例化。 AppDomain的安全状态由配置了NoSecurityChanges标志的AppDomainManager修改。
这些项目的COM引用也标有黄色惊叹号。
我发现这个错误的唯一google结果是这里:
http://social.msdn.microsoft.com/Forums/en/vsx/thread/197b8dca-5610-4ac5-86fc-c56d5182e46b
其中描述了完全相同的问题,但没有解决。我尝试添加
< GenerateResourceNeverLockTypeAssemblies> true< GenerateResourceNeverLockTypeAssemblies>
作为帖子建议,但对我没有任何影响。
任何人都知道这一点吗?
谢谢。
我登录到我的DX帐户,发现(令我吃惊的是),DX提供了对相同2008.3版本的新修补程序版本的升级(尽管我的订阅已过期)。这解决了问题(并且允许我根本不必使用旧版安全策略)。
I have a project using DevExpress 8.3 (2008.3) which I just recently upgraded to use VS 2010. After doing so, everything compiled fine but I got errors trying to use the designer. I resolved this as described here: NetFx40_LegacySecurityPolicy in design-time mode
by adding <NetFx40_LegacySecurityPolicy enabled="true"/>
to my devenv.exe.config.
Designer works fine now, but some of the projects in the solution which have COM references no longer compile, with the exception:
The "ResolveComReference" task could not be instantiated from "Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a". The security state of an AppDomain was modified by an AppDomainManager configured with the NoSecurityChanges flag.
The COM references for those projects are also flagged with a yellow exclamation mark.
The only google result I found for this error was here: http://social.msdn.microsoft.com/Forums/en/vsx/thread/197b8dca-5610-4ac5-86fc-c56d5182e46b
which describes the exact same problem but with no resolution. I tried adding
<GenerateResourceNeverLockTypeAssemblies>true<GenerateResourceNeverLockTypeAssemblies>
as the post suggests but that doesn't have any effect for me.
Anyone know anything about this?
Thanks.
I logged into my DX account and found (to my surprise) that DX was offering me an upgrade to a new hotfix version of the same 2008.3 release (even though my subscription is expired). This fixed the problem (and allowed me not to have to use Legacy Security Policy at all).
这篇关于Visual Studio 2010中的旧版安全策略和COM参考的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!