Make each csproj in a solution target a different C# version

后端 未结 2 1196
后悔当初
后悔当初 2021-01-18 23:32

I have a solution that contains five C# console application projects. I would like each project to target a different version of C#.

MyLearningSolution.sln
         


        
相关标签:
2条回答
  • 2021-01-19 00:20

    Right click on Project, go to Properites, There under Build click the Advanced.. button, there you can specify Language version.

    enter image description here

    0 讨论(0)
  • 2021-01-19 00:28

    This can be done by looking at the <LangVersion> element of the csproj file. Possible values:

    <LangVersion>default</LangVersion>
    <LangVersion>ISO-1</LangVersion>
    <LangVersion>ISO-2</LangVersion>
    <LangVersion>3</LangVersion>
    <LangVersion>4</LangVersion>
    <LangVersion>5</LangVersion>
    

    To do it via the UI, go to Project Properties => Build => Advanced... => Language Version

    0 讨论(0)
提交回复
热议问题