You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
C#: Support for building with the dotnet CLI
By adding a reference to the 'Microsoft.NETFramework.ReferenceAssemblies' nuget package, we can build projects targeting .NET Framework with the dotnet CLI. By referencing this package we also don't need to install Mono on Linux/macOS or .NET Framework on Windows, as the assemblies are taken from the package.
This commit is contained in:
@@ -125,6 +125,12 @@ namespace GodotTools.ProjectEditor
|
||||
// References
|
||||
var referenceGroup = root.AddItemGroup();
|
||||
referenceGroup.AddItem("Reference", "System");
|
||||
var frameworkRefAssembliesItem = referenceGroup.AddItem("PackageReference", "Microsoft.NETFramework.ReferenceAssemblies");
|
||||
|
||||
// Use metadata (child nodes) instead of attributes for the PackageReference.
|
||||
// This is for compatibility with 3.2, where GodotTools uses an old Microsoft.Build.
|
||||
frameworkRefAssembliesItem.AddMetadata("Version", "1.0.0");
|
||||
frameworkRefAssembliesItem.AddMetadata("PrivateAssets", "All");
|
||||
|
||||
root.AddImport(Path.Combine("$(MSBuildBinPath)", "Microsoft.CSharp.targets").Replace("/", "\\"));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user