Skip to content

C#: Fallback to the latest SDK#83325

Merged
akien-mga merged 1 commit intogodotengine:masterfrom
raulsntos:dotnet/find-latest-sdk
Oct 24, 2023
Merged

C#: Fallback to the latest SDK#83325
akien-mga merged 1 commit intogodotengine:masterfrom
raulsntos:dotnet/find-latest-sdk

Conversation

@raulsntos
Copy link
Member

When trying to find the .NET SDK, we were using MSBuildLocator.RegisterDefaults as a fallback assuming it was picking the latest one. That's not correct, it uses the first one it finds (see microsoft/MSBuildLocator#81).

@raulsntos raulsntos added this to the 4.2 milestone Oct 14, 2023
@raulsntos raulsntos requested a review from a team as a code owner October 14, 2023 12:33
@akien-mga akien-mga merged commit 398b254 into godotengine:master Oct 24, 2023
@akien-mga
Copy link
Member

Thanks!

@jasonswearingen
Copy link

jasonswearingen commented Oct 26, 2023

EDIT: setting the env var DOTNET_ROLL_FORWARD_TO_PRERELEASE to 1 and now it builds/runs properly.

Original Message:

@raulsntos dotnet8rc2 does not seem to work with godot 4.2 beta3 (on Win11x64).
I set my C# .csproj target framework to:
<TargetFramework>net8.0</TargetFramework>

It looks like the C# project builds fine (both via Visual Studio and Godot's build) but when running via the godot editor the following error occurs:

modules/mono/mono_gd/gd_mono.cpp:538 - .NET: Failed to load project assembly. (User)
modules/mono/mono_gd/gd_mono.cpp:538 - .NET: Failed to load project assembly. (User)
modules/mono/mono_gd/gd_mono.cpp:538 - .NET: Failed to load project assembly. (User)
modules/mono/mono_gd/gd_mono.cpp:512 - .NET: Giving up on assembly reloading. Please restart the editor if unloading was failing. (User)

No additional info is given when I set The Godot Editor's setting DotNet->build-> verbosity to "Diagnostic"

sorry I am not familiar with godot's build/engine internals, but If you want me to help test fixes for the next beta, let me know

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generating the C# project fails when .Net 8 Sdk is installed.

3 participants