简体   繁体   中英

visual studio C# 2010 conversion issue

Running to this issue. I open a project in visual studio 2010. The conversion wizard comes up, I press finish. It opens the project but fails to compile complaining about missing assembly referencs when all references are there. I suspect it is because of conversion. The .csproj file is changed from :

<Project DefaultTargets="Build"      
 xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">

TO

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">

So target framework has changed. How do I disable this? I am not doing anything from my side. Just opening the project and it is failing to compile. Is there some intellifence in Visual Studio 2010 to disable or NOT do this, so I can do some development and compile things. It references a ton of other projects and I don't have the option of converting them.

The project was initially developed in 2008 and I am now opening in VS 2010.

Update It looks like the problem is some of the assemblies referenced from this older application have been upgraded to target framework 3.5. But this application is still targeting 2.0. So I upgraded its target framework.

Now there is another problem. Both this application and a referenced assembly have a reference to an assembly A. But application is referencing A 5.0 whereas the referenced assembly is referencing version A 6.0. So Visual studio is complaining about that. Why do these versions have to match? Can't the application and its referenced assembly use different versions of common assembly?

The error reporting in visual studio is shady and pathetic.

No, that hasn't changed the target framework. It's changed the tools version. It should still be targeting the same version of the framework.

Any particular assembly? are the missing references from .NET fwk or your own assemblies? I recall that you can skip the converter by incrementing the version number from 10 to 11 in the csproj file (if you come from vs2008 that is)

Update It looks like the problem is some of the assemblies referenced from this older application have been upgraded to target framework 3.5. But this application is still targeting 2.0. So I upgraded its target framework.

Now there is another problem. Both this application and a referenced assembly have a reference to an assembly A. But application is referencing A 5.0 whereas the referenced assembly is referencing version A 6.0. So Visual studio is complaining about that. Why do these versions have to match? Can't the application and its referenced assembly use different versions of common assembly?

The error reporting in visual studio is shady and pathetic.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM