Modify .csproj files programmatically

前端 未结 1 1203
無奈伤痛
無奈伤痛 2020-12-09 06:14

I have source code of Entlib 5.0 and I need sign all assemblies using my own key (snk file).

The easiest way would be to open the EnterpriseLibrary.2010 solution fil

相关标签:
1条回答
  • 2020-12-09 06:31

    You can take a look at the Microsoft.Build.BuildEngine namespace MSDN Link

    Sample code:

    Engine eng = new Engine()
    Project proj = new Project(eng);
    proj.Load(FullProjectPath);
    proj.SetProperty("SignAssembly", "true");
    proj.Save(FullProjectPath);
    

    I recently used something similar to make a series of changes across all of my company's .csproj files (over 200) instead of manually opening each project and making changes.

    Hope this helps.

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