slfan
slfan

Reputation: 9129

Development for .NET 4.0 (Windows XP) with Visual Studio 2012

.NET 4.5 is an in-place-upgrade and therefore replaces .NET 4.0. Consequently when I install .NET 4.5 with Visual Studio 2012 I can no longer develop applications for .NET 4.0.

As .NET 4.5 is not supported under Windows XP, how can I maintain my existing .NET 4.0 applications which still have to run under Windows XP after I installed Visual Studio 2012?

Until now I could always devlop .NET applications for every version, even .NET 1.1, as long as VS2003 was installed. I don't have a problem with Microsoft not supporting .NET 4.5 on XP, I think it's allright to cut off old stuff. But as we have still customers using Windows XP, we need to be able to create .NET 4.0 programs at the same time as .NET 4.5.

EDIT:

I just had my first incompatibility issue: I installed VS 2012 on a Windows Server 2012. I created a project targeting .NET 4.0. In blend 4.0 I create a copy of a control template of a checkbox. The generated template contains references on colors which are available only under .NET 4.5. The solution cannot be compiled any longer. However the same case works fine on my Windows 7 installation.

I assume that the installation of .NET 4.5 has replaced the control templates for my standard controls. Therefore I cannot create copies any longer.

Upvotes: 5

Views: 14611

Answers (4)

Jordan
Jordan

Reputation: 5445

I have run into some serious issues developing .NET programs for 4.0 against computers with 4.5 installed. One issue, for instance, is that if you are doing WPF development and have a private setter on a property - if you're binding to that property with Mode=TwoWay, you will not get an exception if you're developing against .NET 4.5! You should get an exception and you will if you're in an environment with only .NET 4.0 installed (even though you're developing to target 4.0 in Visual Studio). Now obviously you should not have Mode=TwoWay and a private setter, but maybe you had originally intended for the property to be only OneWay. The point is that this is just one of many examples of issues that are simply swept under the rug by 4.5 and has caused me to go back to developing in Windows 7 with Visual Studio 2010 and .NET 4.0 for anything targeting .NET 4.0.

Upvotes: 2

bernard paulus
bernard paulus

Reputation: 1664

Ironically, it seems Mono supports much of the .NET 4.5 functionality, and that it can be installed on Windows XP.

If your need C# 5.0's async and your client refuses to upgrade it's OS, this can be an option.

Upvotes: 4

slfan
slfan

Reputation: 9129

In the meantime I have found a great blog of Scot Hanselman which answers my concerns: http://www.hanselman.com/blog/NETVersioningAndMultiTargetingNET45IsAnInplaceUpgradeToNET40.aspx

.NET 4.5 is an in-place-upgrade and replaces the .NET 4.0 CLR, but it will still be possible to create .NET 4.0 applications with Visual Studio 2012.

EDIT: I now installed the final release of VS2012. My existing .NET 4.0 projects compile and run, no problems so far. The only drawback is, it doesn't support Windows Installer Projects any longer. You can switch forward and backward between VS2010 and VS2012.

Upvotes: 2

IWIH
IWIH

Reputation: 415

BIG EDIT: We should wait until Microsoft announces the final decision, it's not clear yet, only conclusions.

But, I think that Microsoft won't drop support for XP and Vista that easy, it appears that the matter of decreasing support is just for speed-purposes to show it to the developers.

Also, if the it comes true and Microsoft Stopped the support for XP and Vista, then you have the virtual machine as an excellent choice!

Best wishes

Upvotes: 1

Related Questions