How can I programmatically (C#) obtain the version of Visual Studio my application was built with?
views:
146answers:
4
+6
A:
Looking at the compiled assembly there is no way you can differentiate between one built with a command line csc or built with visual studio.
Otávio Décio
2009-06-11 16:15:04
Right, Visual Studio itself doesn't compile your program, the C# compiler does. And I have no reason to believe the C# compiler embeds its own version number in the output.
Qwertie
2009-06-11 16:43:53
A:
System.Environment.Version
gives you the .NET version you are using...I know it's not what you asked for, but something interesting.
Aaron
2009-06-11 16:19:25
A:
You can build your application with other tools such as MSBuild. In some larger working environments the F5 build and run is disabled and have much more complext build systems.
I don't think it is possible to tell which version other than the .net version which is requiured.
Coding Monkey
2009-06-11 16:22:27
+1
A:
You could add a new appSettings key in your web.config, and then manually update the value as developers take over in the future.
The .csproj file contains meta data that you could query from.
Jon
2009-06-11 16:51:41