Class SunamoCsprojHelper
- Namespace
- SunamoDevCode.Aps.Projs
- Assembly
- SunamoDevCode.dll
Provides helper methods for analyzing and manipulating .csproj files.
public class SunamoCsprojHelper
- Inheritance
-
SunamoCsprojHelper
- Inherited Members
- Extension Methods
Fields
type
Type information for the SunamoCsprojHelper class.
public static Type type
Field Value
Methods
AddMissingProjects(SolutionFolder, bool)
Adds missing projects to a solution.
public static Task AddMissingProjects(SolutionFolder solutionFolder, bool isAddingDependencies = false)
Parameters
solutionFolderSolutionFolderThe solution folder to add projects to.
isAddingDependenciesboolWhether to also add project dependencies.
Returns
AddMissingProjectsAlsoString(object, bool)
Must be async
public static Task<object> AddMissingProjectsAlsoString(object text, bool addAlsoDepedencies = false)
Parameters
textobjectSolution path or SolutionFolder object
addAlsoDepedenciesboolWhether to add also dependencies
Returns
BuildProjectsDependencyTreeList(string, Dictionary<string, XmlDocument>)
Builds a list of project dependency tree paths for the given .csproj file.
public static Task<List<string>> BuildProjectsDependencyTreeList(string csprojPath, Dictionary<string, XmlDocument> dictToAvoidCollectionWasChanged)
Parameters
csprojPathstringPath to the .csproj file to analyze.
dictToAvoidCollectionWasChangedDictionary<string, XmlDocument>Dictionary to avoid collection modification during iteration.
Returns
DetectNetVersion(string)
Whether is old .net fw, version
public static Task<Tuple<bool, string>> DetectNetVersion(string path)
Parameters
pathstringPath to the csproj file.
Returns
DetectNetVersion2(string)
Detects the .NET framework version and returns it as a SupportedNetFw enum value.
public static Task<SupportedNetFw> DetectNetVersion2(string path)
Parameters
pathstringPath to the csproj file.
Returns
- Task<SupportedNetFw>
The detected .NET framework enum value.
IsProjectCsprojSdkStyleIsCore(string)
Checks whether a csproj is SDK-style and also determines if it targets netstandard.
public static Task<IsProjectCsprojSdkStyleResult?> IsProjectCsprojSdkStyleIsCore(string fileOrContent)
Parameters
fileOrContentstringFile path or content string of the csproj.
Returns
- Task<IsProjectCsprojSdkStyleResult>
Result containing the content, SDK-style status, and netstandard status, or null for invalid XML.