相关疑难解决方法(0)

.NET 4中的混合模式汇编

我在大约2年前在.NET 2.0中编写了一个用于数据库访问的类库,并且一直在.NET 2.0,3.0和3.5上使用它.

在我正在进行的当前项目(这是一个.NET 4.0应用程序)中,尝试使用旧的忠实类库,我得到以下异常:


System.InvalidOperationException was unhandled
  Message=An error occurred creating the form. See Exception.InnerException for details.
    The error is: Mixed mode assembly is built against version 'v2.0.50727' of the runtime
    and cannot be loaded in the 4.0 runtime without additional configuration information.
    Source=SchoolManager
  StackTrace:
       at SchoolManager.My.MyProject.MyForms.Create__Instance__[T](T Instance) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 190
       at SchoolManager.My.MyProject.MyForms.get_frmGeneric()
       at SchoolManager.My.MyApplication.OnCreateMainForm() in D:\Alex\Documents\Visual Studio 2008\Projects\School Manager\SchoolManager\My Project\Application.Designer.vb:line 35
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
       at SchoolManager.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] …

.net mixed-mode .net-4.0

36
推荐指数
2
解决办法
5万
查看次数

C#类向后兼容性规则/避免中断更改

我正在研究C#3.5程序集,它被企业服务器环境中的许多不同应用程序使用.我想在现有的C#类(不是抽象)中添加一些属性,并保持与当前客户端的向后兼容性,而无需重新编译.这是一个强烈命名的3.5组装.现有的客户端应用程序不会被重新编译.相反,我们使用发布者策略程序集将现有客户端重定向到更新版本.

维护这种类向后兼容性的规则是什么?

我正在寻找一些规则,我可以验证我的代码更改.

在我当前尝试更新类客户端之后抛出"找到的程序集的清单定义与程序集引用不匹配"异常.

.net c# backwards-compatibility

23
推荐指数
1
解决办法
6336
查看次数

C#4.0是否向后兼容C#2.0?

我可以知道C#4.0和C#2.0之间的区别是什么?C#4.0是否向后兼容C#2.0?

我可以说C#4.0是C#2.0的超集(就像C++到C的那样)吗?

谢谢.

c# c#-2.0 c#-4.0

8
推荐指数
2
解决办法
2749
查看次数