.NET Framework Platform Update 1–Supported Runtime Config

Update 6/21 - there is a fix for this known issue see KB2468871 look for issue #9

I have found that when you set your app to use .NET Framework Platform Update 1 Visual Studio adds something to your configuration file.  It is trying to do the right thing and here is what you get.

 <configuration>
    <startup> 
       <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0.1,Profile=Client"/>       
    </startup>
</configuration>

Great, but then when I try to run the app on my machine which has .NET Framework Platform Update 1 installed I get this

SNAGHTML97158

You may also see this exception

The 'targetFramework' attribute in the <compilation> element of the Web.config file is used only to target version 4.0 and later of the .NET Framework (for example, '<compilation targetFramework="4.0">').

Fix It The Easy Way

Just delete the targetFramework attribute (it will then default to 4.0) or change it back to 4.0

I’ve heard from more than one of you that you are also experiencing this issue.  There are a couple of connect bugs tracking this issue as well

 

The Hard Way

If you really want to fix it, here is how you can do it.

Create a .reg file with the following, merge with the registry and you are good to go

WARNING: This works on my machine – your results may vary

 Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.0.1,Profile=Client]
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.0.1]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.0.1]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.0.1,Profile=Client]

Happy Coding!

Ron Jacobs
https://blogs.msdn.com/rjacobs
Twitter: @ronljacobs https://twitter.com/ronljacobs