Skip to content

C#: GodotNETSdk should also suppress AppendRuntimeIdentifierToOutputPath. #107914

Open
@invino4

Description

@invino4

Tested versions

Repo: 4.4.0+
(Untested on previous versions, but unlikely a regression)

System information

Windows 10 - Godot Engine v4.4.stable.mono.official.4c311cbee

Issue description

Description

The GodotNETSdk includes the following line in Sdk.props:

<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>

This appears to be intended to force all output paths to be exactly .godot\mono\temp\bin instead of .godot\mono\temp\bin\net8.0. However, if the csproj file also includes a <RuntimeIdentifier> then the output paths are still altered by NetSDK leading to something like .godot\mono\temp\bin\win-x64 (or the like). Perhaps Sdk.props should read:

<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>

This appears to resolve the issue and is in line with the original intent.

Discussion

This begs the question though: why override the output (and intermediary) paths at all? Would it not be better to acquire the output paths from msbuild and then pass those to the Godot runtime for dynamic loading (or have the runtime/Editor invoke msbuild to evaluate $(OutputPath))? This would avoid the necessity to override the output paths to begin with and might make the Godot SDK and Editor more robust to future NetSDK changes that impact output paths. Is there another reason for hard coding the paths?

Steps to reproduce

Add <RuntimeIdentifier>win-x64</RuntimeIdentifier> to the csproj file for the targeted Godot project. Rebuild.

Minimal reproduction project (MRP)

Any project will work.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions