summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorRaul Santos <raulsntos@gmail.com>2023-08-03 13:52:13 +0200
committerRaul Santos <raulsntos@gmail.com>2023-08-03 13:52:13 +0200
commitef0e279fbb8b3814871ac17c0ecb57e5235d1b84 (patch)
tree04d1261fc9a654a1d03acc90b30fbf92f798d750 /modules
parent237bd0a615df8a0e57bc3d299894abece7b43a0c (diff)
downloadredot-engine-ef0e279fbb8b3814871ac17c0ecb57e5235d1b84.tar.gz
Show alert if .NET assemblies dir does not exist
Diffstat (limited to 'modules')
-rw-r--r--modules/mono/mono_gd/gd_mono.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/mono/mono_gd/gd_mono.cpp b/modules/mono/mono_gd/gd_mono.cpp
index 5e52f25cf4..247968e251 100644
--- a/modules/mono/mono_gd/gd_mono.cpp
+++ b/modules/mono/mono_gd/gd_mono.cpp
@@ -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);