简体   繁体   English

将目标框架从.NET 3.5更改为.NET 4.0

[英]Changing Target Framework from .NET 3.5 to .NET 4.0

I have a C# class library project which defines some windows forms controls. 我有一个C#类库项目,该项目定义了一些Windows窗体控件。 This library targets .NET 3.5 and is called from a C++/CLI windows forms project which targets .NET 4.0. 该库针对.NET 3.5,并从针对.NET 4.0的C ++ / CLI Windows窗体项目中调用。 I would like to avoid having my application loading/requiring multiple .NET runtimes. 我想避免让我的应用程序加载/需要多个.NET运行时。 Is it safe if I simply changed the target framework of the class library to .NET 4.0? 如果仅将类库的目标框架更改为.NET 4.0,是否安全? Are there any other changes I need to make? 我还需要进行其他更改吗? What incompatibilities (if any) exist when moving from .NET 3.5 to .NET 4.0? 从.NET 3.5迁移到.NET 4.0时,存在哪些不兼容性(如果有)?

There are no other clients using the windows forms library except for the windows forms application I mentioned. 除了我提到的Windows窗体应用程序之外,没有其他客户端使用Windows窗体库。

I found this page on MSDN, which seems to highlight some migration issues. 我在MSDN上找到了此页面,该页面似乎突出了一些迁移问题。

http://msdn.microsoft.com/en-us/library/vstudio/ee941656%28v=vs.100%29.aspx http://msdn.microsoft.com/en-us/library/vstudio/ee941656%28v=vs.100%29.aspx

If your C# library depends on third party components, you may want to also review what framework dependencies they may have. 如果您的C#库依赖于第三方组件,则可能还需要查看它们可能具有的框架依赖项。

If you do not have any framework restrictions from researching the above, it should be relatively safe to just change the target version of the framework in the Application section of the Project Settings. 如果您没有因上述研究而受到任何框架限制,则仅在“项目设置”的“应用程序”部分中更改框架的目标版本应该相对安全。 If you do not receive any compile errors, you should just test your application to verify how it responds. 如果未收到任何编译错误,则应仅测试应用程序以验证其响应方式。

As Windows Forms hasn't changed all that much since 3.5 I'm pretty certain you're not going to encounter any issues, such as breaking API issues, it should just be a simple recompile. 由于Windows Forms自3.5以来没有发生太大变化,我可以肯定地说您不会遇到任何问题,例如中断API问题,因此它应该只是一个简单的重新编译。

Even if you're referencing libraries which use an older version of the .NET framework it will still work due to Side-by-Side execution . 即使您引用的库使用的是.NET框架的较早版本,由于并排执行,它仍然可以使用。 But even still if possible I would update the third party libraries for releases for .NET 4.0 但是,即使有可能,我仍将为.NET 4.0版本更新第三方库。

I would also add that .NET 4 Winforms applications can reference.NET 3.5 class libraries again using side-by-side execution. 我还要补充一点,.NET 4 Winforms应用程序可以使用并行执行再次引用.NET 3.5类库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将项目的.NET目标框架从4.0更改为3.5后,找不到文件(或程序集) - File (or assembly) can't be found after changing project's .NET target-framework from 4.0 to 3.5 将点网目标框架从4.0更改为4.5不会更改所引用dll的运行时版本。 - Changing dot net target framework from 4.0 to 4.5 is not changing the Runtime version of the dll referenced. 从4.0 .NET Framework从字符串到整数错误的转换 - Conversion from string to integer error in 3.5 from 4.0 .NET Framework 带有SQL CE 4.0的.NET 3.5中的实体框架 - Entity Framework from .NET 3.5 with SQL CE 4.0 从.NET Framework 3.5升级到4.0后,下拉列表中没有浏览器回发 - No browser postback on dropdownlist after upgrading from .NET framework 3.5 to 4.0 尝试从Framework 4.0更改为3.5 .NET时出现问题 - Problems trying to change from Framework 4.0 to 3.5 .NET 网站已编译为.net 3.5作为目标框架,但似乎仍引用.net 4.0 - Site compiled to .net 3.5 as target framework but still seems to reference .net 4.0 可在.NET Framework 3.5或4.0上运行的可执行文件 - Executable running on either .NET Framework 3.5 or 4.0 将目标框架从v4.0更改为v3.5后,找不到命名空间 - Namespace cannot be found after changing target framework from v4.0 to v3.5 .Net Framework 4.0安装程序是否包含.Net Framework 3.5? - Does the .Net Framework 4.0 Installer include the .Net Framework 3.5?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM