Tag: 混合模式

.NET 4中的混合模式程序集

大约两年前,我在.NET 2.0中编写了一个用于数据库访问的类库,并一直在.NET 2.0,3.0和3.5上使用它。 在当前正在进行的项目(.NET 4.0应用程序)中,尝试使用旧的忠实类库,并得到以下exception: System.InvalidOperationException是未处理的 消息=创build表单时发生错误。 有关详细信息,请参阅Exception.InnerException。 错误是:混合模式程序集是针对运行时版本“v2.0.50727”构build的 并且不能在没有附加configuration信息的情况下在4.0运行时加载。 来源= SchoolManager 堆栈跟踪: at SchoolManager.My.MyProject.MyForms.Create__Instance __ [T](T Instance)in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 190 在SchoolManager.My.MyProject.MyForms.get_frmGeneric() D:\ Alex \ Documents \ Visual Studio 2008 \ Projects \ School Manager \ SchoolManager \ My Project \ Application.Designer.vb中的SchoolManager.My.MyApplication.OnCreateMainForm()中:第35行 在Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun() 在Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel() 在Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String [] commandLine) at SchoolManager.My.MyApplication.Main(String [] Args)in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81 在System.AppDomain._nExecuteAssembly(RuntimeAssembly程序集,String [] args) […]

什么'useLegacyV2RuntimeActivationPolicy'在.NET 4configuration?

在将使用SlimDX并因此具有非托pipe代码的项目转换为.NET 4.0时,我遇到了以下错误: 混合模式程序集是针对运行时版本“v2.0.50727”构build的,不能在没有附加configuration信息的情况下在4.0运行时加载。 谷歌search给了我的解决scheme,这是添加到应用程序configuration: <configuration> <startup useLegacyV2RuntimeActivationPolicy="true"> <supportedRuntime version="v4.0"/> </startup> </configuration> 我的问题是, useLegacyV2RuntimeActivationPolicy在做什么? 我找不到任何文件。