-
-
Notifications
You must be signed in to change notification settings - Fork 21.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash when trying to open C# project with .NET installed in non-standard location (but in PATH) #66353
Comments
Godot should also be looking at the location of the dotnet executable in Also, do the You can also try setting the |
Nor
However, setting
|
Similar problem on Windows 11, my fiancée has the game close instantly and running from command prompt yields ".NET: Failed to load hostfxr" as the only output. She does have .NET 7 installed in the standard location, and hostfxr.dll definitely exists in the right folder. I'm building the game with v4.0.rc2.mono.official [d2699dc]. |
@Anixias Would you be able to open the game from a terminal with the An exported game should contain the hostfxr.dll in the data folder, if you move the game binary make sure to move the data folder with it. Perhaps you run into #72159. |
I'll give it a shot when I can. That seems like it could be the issue I'm facing, although the same PCK works on my own computer. |
I've had this hostfxr problem (v4.0.stable.mono.official [92bee43]) and solved it, though I suspect it can have many different causes. In my case I could run the project from the editor, but if I exported the project and tried to run the exported .exe, I get
It sounds like @Zekiah-A is having the problem in the editor (?), while @Anixias has the problem when launching an exported game (like me). Godot 4.0 beta 16 introduced Initial .NET 7 support, and Anixias mentions "She does have .NET 7 installed". However, I see that initial .NET 7 support "does not change the target framework the godot assemblies, instead it just allows the godot editor to run using the latest .NET version installed on the machine (including .NET 7).". Perhaps the editor runs because it can run on .net 7, but the project doesn't build correctly because it targets .net 6 and .net 6 is not installed? I've not looked into this .net 7 support, so that is just a suggestion shooting from the hip and may not be the cause. The cause of my There's two ways to know this is happening, firstly the "Publishing .NET project..." step is skipped during export - the export is suspiciously fast and this I don't see this progress-bar dialog (I do still see the other progress-bar dialog) Secondly, the editor is missing the MSBuild panel, I see: In my case, the trigger was that my .sln file didn't have the same file name as the So I assume Godot couldn't find the .sln file, silently switched into some sort of "not a dotnet project" mode and so didn't do a complete build when exporting the project. I presume the reason the project was running fine in the editor is I had been developing the c# parts in a different IDE (vs2022) which meant the assemblies were already compiled and present somewhere that Godot was expecting. So if an exported file quits with In my specific case, the settings don't allow me to specify a .sln (only a solution directory, in my case the parent directory), and don't make it clear that the solution file must stay named the same as the In in the meantime I can now keep an eye on whether the MSBuild panel exists |
Try this: wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh
chmod 777 dotnet-install.sh
./dotnet-install.sh --channel 7.0
export PATH="$PATH:$HOME/.dotnet"
|
How do I point godot to the right folder? |
Godot version
Godot Engine v4.0.beta1.mono.official (4ba934b)
System information
Arch Linux, Vulkan, GTX 1050
Issue description
When attempting to open a C# project on godot 4 beta mono I get the following error
I do have dotnet installed, evident as when I run,
, you can see everything is installed as expected, when I run
which dotnet
, I get/home/zekiah/dotnet/dotnet
, I suspect this may be an issue as godot is only seeming to look inERROR: The host fxr folder does not exist: /usr/share/dotnet/host/fxr
for dotnet. When searching within/home/zekiah/dotnet/dotnet
, thehost/fxr
dir does exist there.Steps to reproduce
Minimal reproduction project
No response
The text was updated successfully, but these errors were encountered: