Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is the Target Framework dropdown empty and greyed out in my C# class library, VS2008

Fairly self-explanatory. I have recently installed .NET framework 4 and VS2010 but I want to compile my 3.5 projects using 3.5 as 4 has not yet been installed on our production servers and I get "This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded." if I try

All project types have the target framework dropdown greyed out

like image 806
Nick Allen Avatar asked Jun 08 '10 15:06

Nick Allen


1 Answers

Make sure that your registry keys:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\OnlyUseLatestCLR

and

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\OnlyUseLatestCLR

are set to 0 (not 1).

This fixed it for me since applications like VS2008 are no longer forced to use .NET 4.0 runtime. I had previously set these registry keys to allow Powershell run inder .NET 4.0, however, a config file should be used for that instead.

like image 101
ephere Avatar answered Oct 07 '22 12:10

ephere