Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

To run this application, you first must install .Net 4.5

I have a wpf project that I created in VS2012, but am now trying to hack in VS2010.

In the csproj file I removed the 'required version' stuff. I can open the project in VS2010, I can compile it too, but if I try to run it, I get the 'needs v4.5' message.

I tried removing all the references and adding them back in again: still compiles (so all the dependencies should be on my (XP) machine).

Where else should I be looking?

like image 839
Benjol Avatar asked Feb 07 '13 07:02

Benjol


2 Answers

Check the <supportedRuntime> element in your .config file.

If it's set to <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> then it will be looking for .NET 4.5. (And, of course, this setting isn't used at all during compilation, which is why VS won't be issuing any warnings or errors about it when you compile)

like image 142
Damien_The_Unbeliever Avatar answered Oct 08 '22 05:10

Damien_The_Unbeliever


You need to change the Target Framework set in the Project properties.

If all else fails, then just create a new solution with a WPF application project and add all the cs files and everything else from your other solution and try then.

like image 40
dutzu Avatar answered Oct 08 '22 07:10

dutzu