Monday, June 17, 2013

How to tell if you have .Net 4.5 installed

Since 4.5 is a drop in replacement for 4.0 you can't just look at the version and build number, v4.0.30319..
You have to look in the registry for HKLM\Software\Microsoft\NET Framework Setup\NDP\v4\Full.
If you have only version 4.0, "Version" is "4.0" and there is no "Release" key.
The official Microsoft documentation says that if the "Release" key exists and it's value is greater than 378389, then it's 4.5.
 My observation of looking at exactly two machines: If you already have .Net 4.5 installed, the value of "Version" is 4.5.50709.

Monday, June 10, 2013

Visual Studio 2012 Error: Could not find ... specified for Main method

This morning I ran into a problem while trying to compile.  Visual Studio 2012 gave me this error:
"Could not find 'Test.GetWebPage' specified for Main method"
I tried removing the file with the method from the project - since I could find no other bit of code referencing "GetWebPage", but Visual Studio still would not compile, complaining that file "CSC" needed it.
The issue was I had set GetWebPage as the startup object and now the method was gone.
To fix: inside Solution Explorer, right click on the project and select "Properties...".  Then under "Applicaiton" set the "Startup object:" to "(Not set)".