views:

57

answers:

2

I've migrated my project to VS2010 but have not yet targeted .NET 4.0. It's currently targeting 3.5 SP1 (and CLR 2). The project relies on several third party components -- mostly open source -- that were presumably built against the 2.0 CLR.

Can I simply retarget my project to the 4.0 runtime? Or do I have to get new versions of all the referenced assemblies on which it depends?

I've read a little about the new in-process side-by-side feature of .NET 4.0, but I don't think it applies here (the example I read was about two different .NET plug ins to an office application). My situation is different. My solution directly references assemblies and I wouldn't think side-by-side applies -- unless I don't understand its purpose.

TIA

A: 

Try running your app using .NET 4.0 (without changing it) by using the method described here:

http://social.msdn.microsoft.com/Forums/en/netfxsetupprerelease/thread/d6d8957e-742a-4cc2-b5c1-d9130ea423d0

If it works and there are no issues, you can migrate your project by retargeting to .NET 4.

Allon Guralnek
+1  A: 

You can probably retarget, but the success or failure will depend entirely on the specifics of what your application is doing.

Have a look through the links posted here: Breaking changes in .NET 4.0.

Most breaking changes will either be compiler issues or Framework issues. You most likely don't need to worry about compiler issues, because you've already migrated to Visual Studio 2010. Breaking changes in the Framework, on the other hand, are very important to understand, because you may not notice them until long after you've deployed a new version and the bug reports start pouring in.

Aaronaught
I guess my point of confusion is whether the third party assemblies need to be recompiled from source. As for my own code, I don't think I'll run into any of the breaking changes.
Decker
@Decker: You would need to enable mixed-mode assemblies. See the answer to this: http://stackoverflow.com/questions/2455654/net-4-0-project-reference-2-0-assembly
Aaronaught