Last active
October 2, 2017 15:24
-
-
Save TerribleDev/39fc4f17202ebe0f8dc6cdef4594a079 to your computer and use it in GitHub Desktop.
Programmatically Set C# Language Version across many projects
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Microsoft.Build.Evaluation.Project; | |
| using System.IO; | |
| void Main() | |
| { | |
| var files = Directory.GetFiles(@"c:\projects\projectRoot\", "*.csproj", SearchOption.AllDirectories); | |
| foreach (var file in files) | |
| { | |
| var project = new Project(file); | |
| project.SetProperty("LangVersion", "6"); | |
| project.Save(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment