开发者

checking dependency to older dot net versions

开发者 https://www.devze.com 2022-12-17 22:15 出处:网络
I have some project that written in .net 3.5 environment. But there still some dependency to .net 2.0 .

I have some project that written in .net 3.5 environment.

But there still some dependency to .net 2.0 .

How I can find this dependence parts of the code that use the old A开发者_运维问答PI ? I just want to update all code to 3.5 version.

Project written in vb.net.

Thanks a lot for help.


The .NET 3.0, 3.5 and 3.5 SP1 releases contain just additional assemblies, added to the .NET 2.0 CLR and core assemblies. You can check if you have 3.5 dependencies by looking through the assemblies listed in the References node of your project. That node is hidden in the VB.NET IDE, click the Show All Files icon in the Solution Explorer window to see it.

Look at the Version property in the Properties window. If it says 3.0.0.0 or 3.5.0.0 then you have a dependency on a later release of .NET. Another trick is Project + Properties, Compile tab, scroll down, Advanced Compile Options, Target framework = 2.0. That will put a warning icon on references in your project that are not available in the 2.0 release.


Update the references to the 3.5 version - when building the compiler will show you any obsolete method calls and incompatibilities.


You can't update all dependencies to version 3.5. The .NET 3.0 and 3.5 libraries are just additions to the 2.0 framework, so the core libraries are still version 2.

For example, while System.Xml.Linq.dll is version 3.5, System.Xml.dll is still version 2.0.


The easiest way is to set the target framework in Visual Studio 2008 to 3.5 and let the compiler do the work. However as mentioned, 3.5 is additive to 2.0, so the CLR version is still 2.0.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号