Ich habe eine VS-Lösung erhalten, die wie folgt aussieht:Bearbeiten einer Lösung mit C#, Visual Studio und msbuild
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.40629.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Demonstation", "Demonstation\Demonstation.csproj", "{8ABE7A72-527A-4E18-8442-9632F1AA83D5}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Folder 1", "Folder 1", "{416E314D-54A7-4A98-955D-86513A1EDBBF}"
ProjectSection(SolutionItems) = preProject
XMLFile1.xml = XMLFile1.xml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Folder 2", "Folder 2", "{B955928E-FADA-413D-839B-3A2D72A63A06}"
ProjectSection(SolutionItems) = preProject
TextFile1.txt = TextFile1.txt
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Folder 3", "Folder 3", "{AA6C508F-817F-42F8-A3F8-2450BCC03FC5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Important", "Important\Important.csproj", "{F7A45E90-5F30-4F5E-9EFA-F44AB260A731}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "even_more_important", "even_more_important\even_more_important.csproj", "{23C38EED-2893-406D-8184-7004C2F2D57F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8ABE7A72-527A-4E18-8442-9632F1AA83D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8ABE7A72-527A-4E18-8442-9632F1AA83D5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8ABE7A72-527A-4E18-8442-9632F1AA83D5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8ABE7A72-527A-4E18-8442-9632F1AA83D5}.Release|Any CPU.Build.0 = Release|Any CPU
{F7A45E90-5F30-4F5E-9EFA-F44AB260A731}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F7A45E90-5F30-4F5E-9EFA-F44AB260A731}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F7A45E90-5F30-4F5E-9EFA-F44AB260A731}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F7A45E90-5F30-4F5E-9EFA-F44AB260A731}.Release|Any CPU.Build.0 = Release|Any CPU
{23C38EED-2893-406D-8184-7004C2F2D57F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{23C38EED-2893-406D-8184-7004C2F2D57F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{23C38EED-2893-406D-8184-7004C2F2D57F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{23C38EED-2893-406D-8184-7004C2F2D57F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{8ABE7A72-527A-4E18-8442-9632F1AA83D5} = {416E314D-54A7-4A98-955D-86513A1EDBBF}
{F7A45E90-5F30-4F5E-9EFA-F44AB260A731} = {B955928E-FADA-413D-839B-3A2D72A63A06}
{23C38EED-2893-406D-8184-7004C2F2D57F} = {AA6C508F-817F-42F8-A3F8-2450BCC03FC5}
EndGlobalSection
EndGlobal
Wie Sie sehen können, gibt es drei Ordner.
Meine Aufgabe ist es, Ordner 1 mit allem innerhalb (Dateien + Unterverzeichnis) aus der Lösung mit C#, Visual Studio und Msbuild zu löschen. Ich habe bereits im Internet nach einem ähnlichen Problem gesucht. Leider habe ich keine Einträge gefunden, die mich mit meinem speziellen Problem, außer diesen beiden helfen könnte:
How do i build a solution programmatically in C#?
api to check for project variables and reference paths in a project file
Was ich brauche, sind einige Codierung Beispiele für mit msbuild Kennenlernen und hilfreiche Hinweise, wie Sie diese Aufgabe lösen können.
Vielen Dank im Voraus für Ihre Antworten!
Mit freundlichen Grüßen Neue Ubuntu User-
Mögliche Duplikate von [Best Practices für die Bearbeitung von sln, proj, suo-Dateien?] (http://stackoverflow.com/questions/3877290/) Best-Practices-für-Editing-sln-proj-suo-Dateien) – stijn