Koushik
Koushik

Reputation: 156

How does Visual Studio determine the C# version for a project and where is it stored?

Recently I changed the language version from the Advanced option in the Build section in Project properties. I changed it from 5.0 to 6.0. The target framework of the project is .Net 4.6.2. The project file got checked out but I did not see any difference. Where is this information stored? How Visual Studio is able to identify the language version if nothing changes in the .csproj file?

Upvotes: 0

Views: 720

Answers (1)

DavidG
DavidG

Reputation: 118937

You are working under the false assumption that your csproj file hasn't change. Try pressing save, you should see a difference in there, a line like this:

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <LangVersion>6</LangVersion> <!-- This line -->
</PropertyGroup>

Upvotes: 4

Related Questions