Class ChangeProjects
- Namespace
- SunamoDevCode.ToNetCore.research
- Assembly
- SunamoDevCode.dll
Provides methods for changing target framework monikers in .csproj project files.
public class ChangeProjects
- Inheritance
-
ChangeProjects
- Inherited Members
- Extension Methods
Fields
end
Closing XML tag for TargetFramework element in csproj files.
public const string end = "</TargetFramework>"
Field Value
net472
Target framework moniker for .NET Framework 4.7.2.
public const string net472 = "net472"
Field Value
net48
Target framework moniker for .NET Framework 4.8.
public const string net48 = "net48"
Field Value
net5Uap
Target framework moniker for .NET 5.0 UWP/UAP Windows platform.
public const string net5Uap = "net5.0-windows10.0.19041.0"
Field Value
net60
Target framework moniker for .NET 6.0.
public const string net60 = "net6.0"
Field Value
net70Windows
Na mém PC bude mít vše net7.0-windows Bylo by to velmi náročné dělat průběžné změny mezi net7.0 argument net7.0-windows
public const string net70Windows = "net7.0-windows"
Field Value
net7Windows
Target framework moniker for .NET 7.0 Windows platform.
public const string net7Windows = "net7.0-windows"
Field Value
netcoreapp
Target framework moniker for .NET Core App 1.1.
public const string netcoreapp = "netcoreapp1.1"
Field Value
netstandard20
Target framework moniker for .NET Standard 2.0.
public const string netstandard20 = "netstandard2.0"
Field Value
netstandard21
Target framework moniker for .NET Standard 2.1.
public const string netstandard21 = "netstandard2.1"
Field Value
start
Opening XML tag for TargetFramework element in csproj files.
public const string start = "<TargetFramework>"
Field Value
Methods
ChangeProjectTo(string, string, IsNetCore5UpMonikerResult?, string?)
Replace only between TargetFramework
public static Task ChangeProjectTo(string to2, string path, IsNetCore5UpMonikerResult? parsedMonikerTo, string? dontChangeIfSourceIs = null)
Parameters
to2stringTarget framework moniker to change to.
pathstringPath to the csproj file.
parsedMonikerToIsNetCore5UpMonikerResultParsed target moniker result.
dontChangeIfSourceIsstringIf the current framework matches this value, skip the change.
Returns
ChangeProjectsTo(string, List<TWithStringDC<string>>)
Changes target framework in all project files from the list to the specified framework moniker.
public static Task ChangeProjectsTo(string to2, List<TWithStringDC<string>> l)
Parameters
to2stringTarget framework moniker to change to.
lList<TWithStringDC<string>>List of project items containing content and path.
Returns
ChangeProjectsTo(string, List<string>)
Changes target framework in all project files at the specified paths to the given framework moniker.
public static Task ChangeProjectsTo(string to2, List<string> vs)
Parameters
to2stringTarget framework moniker to change to.
vsList<string>List of csproj file paths to update.
Returns
IsNetCore5UpMoniker(string)
Parses a target framework moniker to determine if it is a .NET 5+ style moniker (e.g., net5.0, net7.0-windows).
public static IsNetCore5UpMonikerResult? IsNetCore5UpMoniker(string moniker)
Parameters
monikerstringTarget framework moniker string to parse.
Returns
- IsNetCore5UpMonikerResult
Parsed result with framework version and platform TFM, or null if not a .NET 5+ moniker.
Test()
Tests the IsNetCore5UpMoniker method with various target framework monikers.
public static void Test()