If you have a Visual Studio Solution that is failing to build with the error message Invalid value for ‘OSVersion’ the simplest way to fix this is to set an explicit value for OSVersion in your project file;
- Navigate to your projects folder in the file system
- Locate the project file (.csproj for C# .vbproj for VB)
- Open the project file in Notepad (or any other text editor)
- Modify the file to include an <OSVersion /> tag inside the first Property Group tag
for example
<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <OSVersion /> ..... ..... </PropertyGroup> ..... .....
This issue seemed to first surface in VS2005 and is still present in VS2008, it seems to regularly rear its head when you try to deploy your application using Click Once.