diff --git a/lib/native/win32/ia32/16/edge_coreclr.node b/lib/native/win32/ia32/16/edge_coreclr.node index d07f27fb..ab2406aa 100644 Binary files a/lib/native/win32/ia32/16/edge_coreclr.node and b/lib/native/win32/ia32/16/edge_coreclr.node differ diff --git a/lib/native/win32/ia32/16/edge_nativeclr.node b/lib/native/win32/ia32/16/edge_nativeclr.node index b7e62d06..171cb4e6 100644 Binary files a/lib/native/win32/ia32/16/edge_nativeclr.node and b/lib/native/win32/ia32/16/edge_nativeclr.node differ diff --git a/lib/native/win32/ia32/18/edge_coreclr.node b/lib/native/win32/ia32/18/edge_coreclr.node index 50bba30e..f59855f4 100644 Binary files a/lib/native/win32/ia32/18/edge_coreclr.node and b/lib/native/win32/ia32/18/edge_coreclr.node differ diff --git a/lib/native/win32/ia32/18/edge_nativeclr.node b/lib/native/win32/ia32/18/edge_nativeclr.node index 7d978dfd..0eb31ec5 100644 Binary files a/lib/native/win32/ia32/18/edge_nativeclr.node and b/lib/native/win32/ia32/18/edge_nativeclr.node differ diff --git a/lib/native/win32/ia32/20/edge_coreclr.node b/lib/native/win32/ia32/20/edge_coreclr.node index 1603d3aa..988ad850 100644 Binary files a/lib/native/win32/ia32/20/edge_coreclr.node and b/lib/native/win32/ia32/20/edge_coreclr.node differ diff --git a/lib/native/win32/ia32/20/edge_nativeclr.node b/lib/native/win32/ia32/20/edge_nativeclr.node index 37ea87b7..2fd8ddb9 100644 Binary files a/lib/native/win32/ia32/20/edge_nativeclr.node and b/lib/native/win32/ia32/20/edge_nativeclr.node differ diff --git a/lib/native/win32/ia32/20/node.version b/lib/native/win32/ia32/20/node.version index c1302226..2a393af5 100644 --- a/lib/native/win32/ia32/20/node.version +++ b/lib/native/win32/ia32/20/node.version @@ -1 +1 @@ -20.18.0 \ No newline at end of file +20.18.0 diff --git a/lib/native/win32/x64/16/edge_coreclr.node b/lib/native/win32/x64/16/edge_coreclr.node index a198c776..1b97fe5e 100644 Binary files a/lib/native/win32/x64/16/edge_coreclr.node and b/lib/native/win32/x64/16/edge_coreclr.node differ diff --git a/lib/native/win32/x64/16/edge_nativeclr.node b/lib/native/win32/x64/16/edge_nativeclr.node index 4a18d0e7..0e6e427b 100644 Binary files a/lib/native/win32/x64/16/edge_nativeclr.node and b/lib/native/win32/x64/16/edge_nativeclr.node differ diff --git a/lib/native/win32/x64/18/edge_coreclr.node b/lib/native/win32/x64/18/edge_coreclr.node index 26e61d81..f1007613 100644 Binary files a/lib/native/win32/x64/18/edge_coreclr.node and b/lib/native/win32/x64/18/edge_coreclr.node differ diff --git a/lib/native/win32/x64/18/edge_nativeclr.node b/lib/native/win32/x64/18/edge_nativeclr.node index 88117d12..85e9593f 100644 Binary files a/lib/native/win32/x64/18/edge_nativeclr.node and b/lib/native/win32/x64/18/edge_nativeclr.node differ diff --git a/lib/native/win32/x64/20/edge_coreclr.node b/lib/native/win32/x64/20/edge_coreclr.node index 907e89a6..dea2e14b 100644 Binary files a/lib/native/win32/x64/20/edge_coreclr.node and b/lib/native/win32/x64/20/edge_coreclr.node differ diff --git a/lib/native/win32/x64/20/edge_nativeclr.node b/lib/native/win32/x64/20/edge_nativeclr.node index d651b9a6..3b573e3e 100644 Binary files a/lib/native/win32/x64/20/edge_nativeclr.node and b/lib/native/win32/x64/20/edge_nativeclr.node differ diff --git a/lib/native/win32/x64/20/node.version b/lib/native/win32/x64/20/node.version index c1302226..2a393af5 100644 --- a/lib/native/win32/x64/20/node.version +++ b/lib/native/win32/x64/20/node.version @@ -1 +1 @@ -20.18.0 \ No newline at end of file +20.18.0 diff --git a/lib/native/win32/x64/22/edge_coreclr.node b/lib/native/win32/x64/22/edge_coreclr.node index 9c825f13..0502c4ae 100644 Binary files a/lib/native/win32/x64/22/edge_coreclr.node and b/lib/native/win32/x64/22/edge_coreclr.node differ diff --git a/lib/native/win32/x64/22/edge_nativeclr.node b/lib/native/win32/x64/22/edge_nativeclr.node index a155d7bc..7bd1837a 100644 Binary files a/lib/native/win32/x64/22/edge_nativeclr.node and b/lib/native/win32/x64/22/edge_nativeclr.node differ diff --git a/lib/native/win32/x64/22/node.version b/lib/native/win32/x64/22/node.version index 2fdffdec..ec7ba0e9 100644 --- a/lib/native/win32/x64/22/node.version +++ b/lib/native/win32/x64/22/node.version @@ -1 +1 @@ -22.10.0 \ No newline at end of file +22.10.0 diff --git a/lib/native/win32/x64/23/edge_coreclr.node b/lib/native/win32/x64/23/edge_coreclr.node index 38d204bb..f7b7363e 100644 Binary files a/lib/native/win32/x64/23/edge_coreclr.node and b/lib/native/win32/x64/23/edge_coreclr.node differ diff --git a/lib/native/win32/x64/23/edge_nativeclr.node b/lib/native/win32/x64/23/edge_nativeclr.node index 7da282a7..d02963f5 100644 Binary files a/lib/native/win32/x64/23/edge_nativeclr.node and b/lib/native/win32/x64/23/edge_nativeclr.node differ diff --git a/lib/native/win32/x64/23/node.version b/lib/native/win32/x64/23/node.version index f842f93a..84b76f4d 100644 --- a/lib/native/win32/x64/23/node.version +++ b/lib/native/win32/x64/23/node.version @@ -1 +1 @@ -23.0.0 \ No newline at end of file +23.0.0 diff --git a/src/CoreCLREmbedding/coreclrembedding.cpp b/src/CoreCLREmbedding/coreclrembedding.cpp index 52ebce40..17ddddab 100644 --- a/src/CoreCLREmbedding/coreclrembedding.cpp +++ b/src/CoreCLREmbedding/coreclrembedding.cpp @@ -371,14 +371,44 @@ HRESULT CoreClrEmbedding::Initialize(BOOL debugMode) if (mode != host_mode_t::standalone) { trace::verbose(_X("CoreClrEmbedding::Initialize - host mode: muxer")); - pal::string_t sdkDirectory; - fx_muxer_t::resolve_sdk_dotnet_path(dotnetDirectory, &sdkDirectory); - - pal::string_t dotnetAssemblyPath(sdkDirectory); - append_path(&dotnetAssemblyPath, _X("dotnet.dll")); + std::vector appConfigFiles; + pal::readdir(edgeAppDir, _X("*.runtimeconfig.json"), &appConfigFiles); + pal::string_t runtimeconfigfile; - get_runtime_config_paths_from_app(dotnetAssemblyPath, &configFile, &devConfigFile); + if (appConfigFiles.size() > 1) + { + std::vector edgeAppDirCstr; + pal::pal_clrstring(edgeAppDir, &edgeAppDirCstr); + + throwV8Exception("CoreClrEmbedding::Initialize - Multiple app runtimeconfig files (*.runtimeconfig.json) files exist in the Edge.js application directory (%s).", edgeAppDirCstr.data()); + return E_FAIL; + } + else if (appConfigFiles.size() == 1) + { + runtimeconfigfile = pal::string_t(edgeAppDir); + append_path(&runtimeconfigfile, appConfigFiles[0].c_str()); + + trace::info(_X("CoreClrEmbedding::Initialize - Exactly one (%s) app runtimeconfig file found in the Edge app directory, using it"), runtimeconfigfile.c_str()); + configFile = pal::string_t(runtimeconfigfile); + } + else // No app runtimeconfigfile found, using sdk runtimeconfig + { + pal::string_t sdkDirectory; + + fx_muxer_t::resolve_sdk_dotnet_path(dotnetDirectory, &sdkDirectory); + + + if (sdkDirectory.length() == 0) + { + throwV8Exception("CoreClrEmbedding::Initialize - Could not find any runtimeconfig file ([appname].runtimeconfig.json in app folder nor dotnet.runtimeconfig.json in sdk folder)"); + return E_FAIL; + } + + runtimeconfigfile = pal::string_t(sdkDirectory); + append_path(&runtimeconfigfile, _X("dotnet.dll")); + get_runtime_config_paths_from_app(runtimeconfigfile, &configFile, &devConfigFile); + } } else @@ -775,4 +805,4 @@ CoreClrGcHandle CoreClrEmbedding::CompileFunc(const void* options, const int pay trace::info(_X("CoreClrEmbedding::CompileFunc - Finished")); return function; } -} +} \ No newline at end of file