Not understanding what was going on, I was able to fix this problem for the Windows Forms project that I just converted from VS.Net 2008 to 2010.
After the conversion, the Target Framework still had .Net Framework 2. When I changed it to 4.0, my application could be launched and debugged. Then they noticed a new line in app.config:
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup>
So, for fun, I changed the Target Framework to 2.0, and the line changed to:
<startup><supportedRuntime version="v2.0.50727"/></startup>
The application will still work. Then I deleted the new line and the application started anyway!
Finally, I turned off all my changes and started the conversion again. Now the application will start immediately!
So, if you run into this problem, just try these steps and see if it helps you.
source share