.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
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
- Click-Once + .NET Framework 4 Platform Update 1
- .NET 4 Platform Update 1 not working on Win 2008 R2 x64
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
Comments
- Anonymous
May 27, 2011
There must be a problem somere... take a look at (and vote by the way): connect.microsoft.com/.../click-once-net-framework-4-platform-update-1