Skip to content

Commit

Permalink
Merge pull request #80212 from raulsntos/dotnet/check_api_assemblies_…
Browse files Browse the repository at this point in the history
…dir_exists

Show alert if .NET assemblies dir does not exist
  • Loading branch information
akien-mga committed Aug 3, 2023
2 parents d191a2f + ef0e279 commit 0606ba7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions modules/mono/mono_gd/gd_mono.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,12 @@ void GDMono::initialize() {

godot_plugins_initialize_fn godot_plugins_initialize = nullptr;

// Check that the .NET assemblies directory exists before trying to use it.
if (!DirAccess::exists(GodotSharpDirs::get_api_assemblies_dir())) {
OS::get_singleton()->alert(vformat(RTR("Unable to find the .NET assemblies directory.\nMake sure the '%s' directory exists and contains the .NET assemblies."), GodotSharpDirs::get_api_assemblies_dir()), RTR(".NET assemblies not found"));
ERR_FAIL_MSG(".NET: Assemblies not found");
}

if (!load_hostfxr(hostfxr_dll_handle)) {
#if !defined(TOOLS_ENABLED)
godot_plugins_initialize = try_load_native_aot_library(hostfxr_dll_handle);
Expand Down

0 comments on commit 0606ba7

Please sign in to comment.