diff --git a/eng/testing/linker/project.csproj.template b/eng/testing/linker/project.csproj.template
index c9eeb18f2718c9..e3a89acd653298 100644
--- a/eng/testing/linker/project.csproj.template
+++ b/eng/testing/linker/project.csproj.template
@@ -7,6 +7,7 @@
{MonoAOTCompilerTasksAssemblyPath}
{WasmAppBuilderTasksAssemblyPath}
{JsonToItemsTaskFactoryTasksAssemblyPath}
+ {RuntimeConfigParserTasksAssemblyPath}
{MicrosoftNetCoreAppRuntimePackRidDir}
{RepositoryEngineeringDir}
{TestTargetFramework}
diff --git a/eng/testing/linker/trimmingTests.targets b/eng/testing/linker/trimmingTests.targets
index 539053c71e330a..f1759616bd73be 100644
--- a/eng/testing/linker/trimmingTests.targets
+++ b/eng/testing/linker/trimmingTests.targets
@@ -97,6 +97,7 @@
.Replace('{MonoProjectRoot}', '$(MonoProjectRoot)')
.Replace('{MonoAOTCompilerTasksAssemblyPath}', '$(MonoAOTCompilerTasksAssemblyPath)')
.Replace('{JsonToItemsTaskFactoryTasksAssemblyPath}', '$(JsonToItemsTaskFactoryTasksAssemblyPath)')
+ .Replace('{RuntimeConfigParserTasksAssemblyPath}', '$(RuntimeConfigParserTasksAssemblyPath)')
.Replace('{WasmAppBuilderTasksAssemblyPath}', '$(WasmAppBuilderTasksAssemblyPath)')
.Replace('{MicrosoftNetCoreAppRuntimePackRidDir}', '$(MicrosoftNetCoreAppRuntimePackRidDir)'))"
Overwrite="true" />
diff --git a/eng/testing/tests.mobile.targets b/eng/testing/tests.mobile.targets
index 3beee87d760495..572213ee2c7830 100644
--- a/eng/testing/tests.mobile.targets
+++ b/eng/testing/tests.mobile.targets
@@ -54,13 +54,13 @@
AssemblyFile="$(RuntimeConfigParserTasksAssemblyPath)"
Condition="'$(RuntimeConfigParserTasksAssemblyPath)' != ''" />
-
+
$(PublishDir)$(AssemblyName).runtimeconfig.json
$(PublishDir)runtimeconfig.bin
-
+
diff --git a/eng/testing/tests.wasm.targets b/eng/testing/tests.wasm.targets
index 8618fdb73e3c52..8d6829e47b3387 100644
--- a/eng/testing/tests.wasm.targets
+++ b/eng/testing/tests.wasm.targets
@@ -75,9 +75,15 @@
AssemblyFile="$(WasmBuildTasksAssemblyPath)" />
+
+ <_MainAssemblyPath Condition="'%(WasmAssembliesToBundle.FileName)' == $(AssemblyName) and '%(WasmAssembliesToBundle.Extension)' == '.dll'">%(WasmAssembliesToBundle.Identity)
+ $([System.IO.Path]::ChangeExtension($(_MainAssemblyPath), '.runtimeconfig.json'))
+
+
+
@@ -99,6 +105,7 @@
<_WasmPropertyNames Include="WasmLinkIcalls" />
<_WasmPropertyNames Include="WasmDedup" />
<_WasmPropertyNames Include="IncludeSatelliteAssembliesInVFS" />
+ <_WasmPropertyNames Include="AssemblyName" />
<_WasmPropertiesToPass
Include="$(%(_WasmPropertyNames.Identity))"
diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/tests/TestWithConfigSwitches/System.Diagnostics.DiagnosticSource.Switches.Tests.csproj b/src/libraries/System.Diagnostics.DiagnosticSource/tests/TestWithConfigSwitches/System.Diagnostics.DiagnosticSource.Switches.Tests.csproj
index ea4a7ff67293d5..0662b27d73c5a7 100644
--- a/src/libraries/System.Diagnostics.DiagnosticSource/tests/TestWithConfigSwitches/System.Diagnostics.DiagnosticSource.Switches.Tests.csproj
+++ b/src/libraries/System.Diagnostics.DiagnosticSource/tests/TestWithConfigSwitches/System.Diagnostics.DiagnosticSource.Switches.Tests.csproj
@@ -2,7 +2,6 @@
$(NetCoreAppCurrent)
true
- true
diff --git a/src/libraries/System.Text.Encoding/tests/Encoding/Encoding.cs b/src/libraries/System.Text.Encoding/tests/Encoding/Encoding.cs
index e7640cbea8c8b6..9ae2917806b661 100644
--- a/src/libraries/System.Text.Encoding/tests/Encoding/Encoding.cs
+++ b/src/libraries/System.Text.Encoding/tests/Encoding/Encoding.cs
@@ -64,7 +64,6 @@ public static void GetEncodingsTest()
}
}
- [ActiveIssue("https://github.com/dotnet/runtime/issues/38433", TestPlatforms.Browser)] // wasm doesn't honor runtimeconfig.json
[Theory]
[MemberData(nameof(Encoding_TestData))]
public static void VerifyCodePageAttributes(int codepage, string name, string bodyName, string headerName, bool isBrowserDisplay,
@@ -81,7 +80,6 @@ public static void VerifyCodePageAttributes(int codepage, string name, string bo
Assert.Equal(windowsCodePage, encoding.WindowsCodePage);
}
- [ActiveIssue("https://github.com/dotnet/runtime/issues/38433", TestPlatforms.Browser)] // wasm doesn't honor runtimeconfig.json
[Theory]
[MemberData(nameof(Normalization_TestData))]
public static void NormalizationTest(int codepage, bool normalized, bool normalizedC, bool normalizedD, bool normalizedKC, bool normalizedKD)
diff --git a/src/libraries/System.Text.Encoding/tests/Encoding/EncodingGetEncodingTests.cs b/src/libraries/System.Text.Encoding/tests/Encoding/EncodingGetEncodingTests.cs
index 6a5fc49cf2eb88..2589dd1af4cddf 100644
--- a/src/libraries/System.Text.Encoding/tests/Encoding/EncodingGetEncodingTests.cs
+++ b/src/libraries/System.Text.Encoding/tests/Encoding/EncodingGetEncodingTests.cs
@@ -88,7 +88,6 @@ public CodePageMapping(string name, int codepage)
new CodePageMapping("x-unicode-2-0-utf-8", 65001)
};
- [ActiveIssue("https://github.com/dotnet/runtime/issues/38433", TestPlatforms.Browser)] // wasm doesn't honor runtimeconfig.json
[Fact]
public void TestEncodingNameAndCopdepageNumber()
{
@@ -99,7 +98,6 @@ public void TestEncodingNameAndCopdepageNumber()
}
}
- [ActiveIssue("https://github.com/dotnet/runtime/issues/38433", TestPlatforms.Browser)] // wasm doesn't honor runtimeconfig.json
[Fact]
public void GetEncoding_EncodingName()
{
@@ -119,7 +117,6 @@ public void GetEncoding_EncodingName()
}
}
- [ActiveIssue("https://github.com/dotnet/runtime/issues/38433", TestPlatforms.Browser)] // wasm doesn't honor runtimeconfig.json
[Fact]
public void GetEncoding_WebName()
{
diff --git a/src/libraries/System.Text.Encoding/tests/UTF7Encoding/UTF7EncodingEncode.cs b/src/libraries/System.Text.Encoding/tests/UTF7Encoding/UTF7EncodingEncode.cs
index 781c8447ff1d3d..a2e9654be83e06 100644
--- a/src/libraries/System.Text.Encoding/tests/UTF7Encoding/UTF7EncodingEncode.cs
+++ b/src/libraries/System.Text.Encoding/tests/UTF7Encoding/UTF7EncodingEncode.cs
@@ -6,7 +6,6 @@
namespace System.Text.Tests
{
- [ActiveIssue("https://github.com/dotnet/runtime/issues/38433", TestPlatforms.Browser)] // wasm doesn't honor runtimeconfig.json
public class UTF7EncodingEncode
{
public static IEnumerable
diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj
index ebb11e10aa8b64..4e60c6278c020a 100644
--- a/src/libraries/tests.proj
+++ b/src/libraries/tests.proj
@@ -253,9 +253,6 @@
-
-
-
diff --git a/src/mono/wasm/build/README.md b/src/mono/wasm/build/README.md
index ea7b73ebe2214f..854ea041398fa0 100644
--- a/src/mono/wasm/build/README.md
+++ b/src/mono/wasm/build/README.md
@@ -49,3 +49,29 @@ The various task inputs correspond to properties as:
This should be a step towards eventually having this build as a sdk.
Refer to `WasmApp.targets` for more information about the properties/items used as inputs to the process.
+
+## Updating dependencies needed for building wasm apps
+
+For example, if the wasm targets are using a new task, then references to that
+need to be updated in a few places. Essentially, look for existing references
+to `MonoAOTCompiler`, or `WasmAppBuilder` in the relevant files, and duplicate
+them for the new task assembly.
+
+1. The task assembly dir, and its path need to be in two properties:
+ ```xml
+ $([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'JsonToItemsTaskFactory', 'Debug', '$(NetCoreAppToolCurrent)'))
+ $([MSBuild]::NormalizePath('$(JsonToItemsTaskFactoryDir)', 'JsonToItemsTaskFactory.dll'))
+ ```
+
+ And this needs to be set in:
+ - `Directory.Build.props`
+ - `src/mono/wasm/build/WasmApp.LocalBuild.props`
+ - `src/mono/wasm/build/WasmApp.LocalBuild.targets`
+ - `src/tests/Common/wasm-test-runner/WasmTestRunner.proj`
+
+2. The new dependency (eg. task assembly) needs to be sent to helix as a payload, see `src/libraries/sendtohelixhelp.proj`. Use `MonoAOTCompiler` as an example.
+
+3. Make changes similar to the one for existing dependent tasks in
+ - `eng/testing/linker/trimmingTests.targets`,
+ - `src/tests/Common/wasm-test-runner/WasmTestRunner.proj`
+ - `src/tests/Directory.Build.targets`
\ No newline at end of file
diff --git a/src/mono/wasm/build/WasmApp.InTree.targets b/src/mono/wasm/build/WasmApp.InTree.targets
index 1537277f087d83..b345da95cf93c2 100644
--- a/src/mono/wasm/build/WasmApp.InTree.targets
+++ b/src/mono/wasm/build/WasmApp.InTree.targets
@@ -1,6 +1,7 @@
+
diff --git a/src/mono/wasm/build/WasmApp.LocalBuild.props b/src/mono/wasm/build/WasmApp.LocalBuild.props
index ea87a8bb8ec0e9..d92024f720d46c 100644
--- a/src/mono/wasm/build/WasmApp.LocalBuild.props
+++ b/src/mono/wasm/build/WasmApp.LocalBuild.props
@@ -35,6 +35,7 @@
$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'WasmAppBuilder', 'Debug', '$(_NetCoreAppToolCurrent)', 'publish'))
$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'WasmBuildTasks', 'Debug', '$(_NetCoreAppToolCurrent)', 'publish'))
$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'MonoAOTCompiler', 'Debug', '$(_NetCoreAppToolCurrent)'))
+ $([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'RuntimeConfigParser', 'Debug', '$(_NetCoreAppToolCurrent)'))
$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'JsonToItemsTaskFactory', 'Debug', '$(_NetCoreAppToolCurrent)'))
$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'mono', '$(TargetOS).$(TargetArchitecture).$(RuntimeConfig)'))
@@ -47,6 +48,7 @@
$([MSBuild]::NormalizeDirectory($(BuildBaseDir), 'microsoft.netcore.app.runtime.browser-wasm'))
$([MSBuild]::NormalizeDirectory($(BuildBaseDir), 'MonoAOTCompiler'))
+ $([MSBuild]::NormalizeDirectory($(BuildBaseDir), 'RuntimeConfigParser'))
$([MSBuild]::NormalizeDirectory($(BuildBaseDir), 'JsonToItemsTaskFactory'))
$([MSBuild]::NormalizeDirectory($(BuildBaseDir), 'WasmAppBuilder'))
$([MSBuild]::NormalizeDirectory($(BuildBaseDir), 'WasmBuildTasks'))
@@ -65,6 +67,7 @@
$([MSBuild]::NormalizePath('$(WasmAppBuilderDir)', 'WasmAppBuilder.dll'))
$([MSBuild]::NormalizePath('$(WasmBuildTasksDir)', 'WasmBuildTasks.dll'))
$([MSBuild]::NormalizePath('$(MonoAOTCompilerDir)', 'MonoAOTCompiler.dll'))
+ $([MSBuild]::NormalizePath('$(RuntimeConfigParserDir)', 'RuntimeConfigParser.dll'))
$([MSBuild]::NormalizePath('$(JsonToItemsTaskFactoryDir)', 'JsonToItemsTaskFactory.dll'))
diff --git a/src/mono/wasm/build/WasmApp.LocalBuild.targets b/src/mono/wasm/build/WasmApp.LocalBuild.targets
index c5f431d7d69934..23f5249786d665 100644
--- a/src/mono/wasm/build/WasmApp.LocalBuild.targets
+++ b/src/mono/wasm/build/WasmApp.LocalBuild.targets
@@ -22,6 +22,7 @@
+
true
@@ -64,6 +65,7 @@
$([MSBuild]::NormalizePath('$(WasmAppBuilderDir)', 'WasmAppBuilder.dll'))
$([MSBuild]::NormalizePath('$(WasmBuildTasksDir)', 'WasmBuildTasks.dll'))
$([MSBuild]::NormalizePath('$(MonoAOTCompilerDir)', 'MonoAOTCompiler.dll'))
+ $([MSBuild]::NormalizePath('$(RuntimeConfigParserDir)', 'RuntimeConfigParser.dll'))
$([MSBuild]::NormalizePath('$(JsonToItemsTaskFactoryDir)', 'JsonToItemsTaskFactory.dll'))
diff --git a/src/mono/wasm/build/WasmApp.targets b/src/mono/wasm/build/WasmApp.targets
index 7de0e166aa0ff1..32c55ee12bf6b0 100644
--- a/src/mono/wasm/build/WasmApp.targets
+++ b/src/mono/wasm/build/WasmApp.targets
@@ -122,8 +122,15 @@
$(TargetFileName)
$([MSBuild]::NormalizeDirectory($(WasmAppDir)))
+
+ <_MainAssemblyPath Condition="'%(WasmAssembliesToBundle.FileName)' == $(AssemblyName) and '%(WasmAssembliesToBundle.Extension)' == '.dll' and $(WasmGenerateAppBundle) == 'true'">%(WasmAssembliesToBundle.Identity)
+ <_WasmRuntimeConfigFilePath Condition="$(_MainAssemblyPath) != ''">$([System.IO.Path]::ChangeExtension($(_MainAssemblyPath), '.runtimeconfig.json'))
+
+
+
<_WasmAssembliesInternal Include="@(WasmAssembliesToBundle->Distinct())" />
@@ -136,7 +143,29 @@
-
+
+
+ <_ParsedRuntimeConfigFilePath>$([System.IO.Path]::GetDirectoryName($(_MainAssemblyPath)))\runtimeconfig.bin
+
+
+
+ <_RuntimeConfigReservedProperties Include="RUNTIME_IDENTIFIER"/>
+ <_RuntimeConfigReservedProperties Include="APP_CONTEXT_BASE_DIRECTORY"/>
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/mono/wasm/runtime/driver.c b/src/mono/wasm/runtime/driver.c
index ca98e347dd120b..c880196ebf915c 100644
--- a/src/mono/wasm/runtime/driver.c
+++ b/src/mono/wasm/runtime/driver.c
@@ -7,6 +7,7 @@
#include
#include
#include
+#include
#include
#include
@@ -92,6 +93,8 @@ void mono_trace_init (void);
static MonoDomain *root_domain;
+#define RUNTIMECONFIG_BIN_FILE "runtimeconfig.bin"
+
static MonoString*
mono_wasm_invoke_js (MonoString *str, int *is_exception)
{
@@ -476,6 +479,13 @@ mono_wasm_register_bundled_satellite_assemblies ()
void mono_wasm_link_icu_shim (void);
+void
+cleanup_runtime_config (MonovmRuntimeConfigArguments *args, void *user_data)
+{
+ free (args);
+ free (user_data);
+}
+
EMSCRIPTEN_KEEPALIVE void
mono_wasm_load_runtime (const char *unused, int debug_level)
{
@@ -493,7 +503,8 @@ mono_wasm_load_runtime (const char *unused, int debug_level)
// corlib assemblies.
monoeg_g_setenv ("COMPlus_DebugWriteToStdErr", "1", 0);
#endif
-
+ // When the list of app context properties changes, please update RuntimeConfigReservedProperties for
+ // target _WasmGenerateRuntimeConfig in WasmApp.targets file
const char *appctx_keys[2];
appctx_keys [0] = "APP_CONTEXT_BASE_DIRECTORY";
appctx_keys [1] = "RUNTIME_IDENTIFIER";
@@ -502,6 +513,23 @@ mono_wasm_load_runtime (const char *unused, int debug_level)
appctx_values [0] = "/";
appctx_values [1] = "browser-wasm";
+ char *file_name = RUNTIMECONFIG_BIN_FILE;
+ int str_len = strlen (file_name) + 1; // +1 is for the "/"
+ char *file_path = (char *)malloc (sizeof (char) * (str_len +1)); // +1 is for the terminating null character
+ int num_char = snprintf (file_path, (str_len + 1), "/%s", file_name);
+ struct stat buffer;
+
+ assert (num_char > 0 && num_char == str_len);
+
+ if (stat (file_path, &buffer) == 0) {
+ MonovmRuntimeConfigArguments *arg = (MonovmRuntimeConfigArguments *)malloc (sizeof (MonovmRuntimeConfigArguments));
+ arg->kind = 0;
+ arg->runtimeconfig.name.path = file_path;
+ monovm_runtimeconfig_initialize (arg, cleanup_runtime_config, file_path);
+ } else {
+ free (file_path);
+ }
+
monovm_initialize (2, appctx_keys, appctx_values);
mini_parse_debug_option ("top-runtime-invoke-unhandled");
diff --git a/src/tasks/AndroidAppBuilder/Templates/monodroid.c b/src/tasks/AndroidAppBuilder/Templates/monodroid.c
index 4ed02eb216693f..2e6f93f43a5d03 100644
--- a/src/tasks/AndroidAppBuilder/Templates/monodroid.c
+++ b/src/tasks/AndroidAppBuilder/Templates/monodroid.c
@@ -234,13 +234,13 @@ mono_droid_runtime_init (const char* executable, int managed_argc, char* managed
appctx_values[1] = bundle_path;
char *file_name = RUNTIMECONFIG_BIN_FILE;
- int str_len = strlen (bundle_path) + strlen (file_name) + 2;
- char *file_path = (char *)malloc (sizeof (char) * str_len);
- int num_char = snprintf (file_path, str_len, "%s/%s", bundle_path, file_name);
+ int str_len = strlen (bundle_path) + strlen (file_name) + 1; // +1 is for the "/"
+ char *file_path = (char *)malloc (sizeof (char) * (str_len +1)); // +1 is for the terminating null character
+ int num_char = snprintf (file_path, (str_len + 1), "%s/%s", bundle_path, file_name);
struct stat buffer;
LOG_INFO ("file_path: %s\n", file_path);
- assert (num_char > 0 && num_char < str_len);
+ assert (num_char > 0 && num_char == str_len);
if (stat (file_path, &buffer) == 0) {
MonovmRuntimeConfigArguments *arg = (MonovmRuntimeConfigArguments *)malloc (sizeof (MonovmRuntimeConfigArguments));
diff --git a/src/tests/BuildWasmApps/Wasm.Build.Tests/WasmBuildAppTest.cs b/src/tests/BuildWasmApps/Wasm.Build.Tests/WasmBuildAppTest.cs
index 59b82318a12424..412bf4a3da2eae 100644
--- a/src/tests/BuildWasmApps/Wasm.Build.Tests/WasmBuildAppTest.cs
+++ b/src/tests/BuildWasmApps/Wasm.Build.Tests/WasmBuildAppTest.cs
@@ -85,6 +85,71 @@ public void Bug49588_RegressionTest_NativeRelinking(BuildArgs buildArgs, RunHost
extraProperties: "true",
dotnetWasmFromRuntimePack: false);
+ [Theory]
+ [BuildAndRun]
+ public void PropertiesFromRuntimeConfigJson(BuildArgs buildArgs, RunHost host, string id)
+ {
+ buildArgs = buildArgs with { ProjectName = $"runtime_config_{buildArgs.Config}_{buildArgs.AOT}" };
+ buildArgs = ExpandBuildArgs(buildArgs);
+
+ string programText = @"
+ using System;
+ using System.Runtime.CompilerServices;
+
+ var config = AppContext.GetData(""test_runtimeconfig_json"");
+ Console.WriteLine ($""test_runtimeconfig_json: {(string)config}"");
+ return 42;
+ ";
+
+ string runtimeConfigTemplateJson = @"
+ {
+ ""configProperties"": {
+ ""abc"": ""4"",
+ ""test_runtimeconfig_json"": ""25""
+ }
+ }";
+
+ BuildProject(buildArgs,
+ initProject: () =>
+ {
+ File.WriteAllText(Path.Combine(_projectDir!, "Program.cs"), programText);
+ File.WriteAllText(Path.Combine(_projectDir!, "runtimeconfig.template.json"), runtimeConfigTemplateJson);
+ },
+ id: id,
+ dotnetWasmFromRuntimePack: !(buildArgs.AOT || buildArgs.Config == "Release"));
+
+ RunAndTestWasmApp(buildArgs, expectedExitCode: 42,
+ test: output => Assert.Contains("test_runtimeconfig_json: 25", output), host: host, id: id);
+ }
+
+ [Theory]
+ [BuildAndRun]
+ public void PropertiesFromCsproj(BuildArgs buildArgs, RunHost host, string id)
+ {
+ buildArgs = buildArgs with { ProjectName = $"runtime_config_csproj_{buildArgs.Config}_{buildArgs.AOT}" };
+ buildArgs = ExpandBuildArgs(buildArgs, extraProperties: "20");
+
+ string programText = @"
+ using System;
+ using System.Runtime.CompilerServices;
+
+ var config = AppContext.GetData(""System.Threading.ThreadPool.MaxThreads"");
+ Console.WriteLine ($""System.Threading.ThreadPool.MaxThreads: {(string)config}"");
+ return 42;
+ ";
+
+ BuildProject(buildArgs,
+ initProject: () =>
+ {
+ File.WriteAllText(Path.Combine(_projectDir!, "Program.cs"), programText);
+ },
+ id: id,
+ dotnetWasmFromRuntimePack: !(buildArgs.AOT || buildArgs.Config == "Release"));
+
+ RunAndTestWasmApp(buildArgs, expectedExitCode: 42,
+ test: output => Assert.Contains("System.Threading.ThreadPool.MaxThreads: 20", output), host: host, id: id);
+ }
+
void TestMain(string projectName,
string programText,
BuildArgs buildArgs,
diff --git a/src/tests/Common/wasm-test-runner/WasmTestRunner.proj b/src/tests/Common/wasm-test-runner/WasmTestRunner.proj
index f9479f96746235..5f4d4f084d13be 100644
--- a/src/tests/Common/wasm-test-runner/WasmTestRunner.proj
+++ b/src/tests/Common/wasm-test-runner/WasmTestRunner.proj
@@ -14,6 +14,7 @@
$(CORE_ROOT)\WasmAppBuilder\WasmAppBuilder.dll
$(CORE_ROOT)\MonoAOTCompiler\MonoAOTCompiler.dll
$(CORE_ROOT)\JsonToItemsTaskFactory\JsonToItemsTaskFactory.dll
+ $(CORE_ROOT)\RuntimeConfigParser\RuntimeConfigParser.dll
diff --git a/src/tests/Directory.Build.targets b/src/tests/Directory.Build.targets
index 4bf4c58589776c..8ab2ab3cd31210 100644
--- a/src/tests/Directory.Build.targets
+++ b/src/tests/Directory.Build.targets
@@ -381,6 +381,11 @@
Include="$(ArtifactsBinDir)\JsonToItemsTaskFactory\Debug\$(NetCoreAppToolCurrent)\**"
TargetDir="JsonToItemsTaskFactory/"/>
+
+
+
diff --git a/src/tests/FunctionalTests/Directory.Build.props b/src/tests/FunctionalTests/Directory.Build.props
index a85fa69ca8edda..ca9552dc7812cc 100644
--- a/src/tests/FunctionalTests/Directory.Build.props
+++ b/src/tests/FunctionalTests/Directory.Build.props
@@ -3,7 +3,7 @@
false
false
true
- true
+ true
true
diff --git a/src/tests/FunctionalTests/WebAssembly/Browser/HotReload/ApplyUpdateReferencedAssembly/ApplyUpdateReferencedAssembly.csproj b/src/tests/FunctionalTests/WebAssembly/Browser/HotReload/ApplyUpdateReferencedAssembly/ApplyUpdateReferencedAssembly.csproj
index a7a21112bfc49f..b32d3ba167d612 100644
--- a/src/tests/FunctionalTests/WebAssembly/Browser/HotReload/ApplyUpdateReferencedAssembly/ApplyUpdateReferencedAssembly.csproj
+++ b/src/tests/FunctionalTests/WebAssembly/Browser/HotReload/ApplyUpdateReferencedAssembly/ApplyUpdateReferencedAssembly.csproj
@@ -3,8 +3,6 @@
true
deltascript.json
library
- false
- true
false
true
diff --git a/src/tests/FunctionalTests/WebAssembly/Browser/HotReload/ApplyUpdateReferencedAssembly/Directory.Build.props b/src/tests/FunctionalTests/WebAssembly/Browser/HotReload/ApplyUpdateReferencedAssembly/Directory.Build.props
new file mode 100644
index 00000000000000..1a524b2700d533
--- /dev/null
+++ b/src/tests/FunctionalTests/WebAssembly/Browser/HotReload/ApplyUpdateReferencedAssembly/Directory.Build.props
@@ -0,0 +1,7 @@
+
+
+ false
+ true
+
+
+
diff --git a/src/tests/FunctionalTests/WebAssembly/Browser/RuntimeConfig/Program.cs b/src/tests/FunctionalTests/WebAssembly/Browser/RuntimeConfig/Program.cs
new file mode 100644
index 00000000000000..6d1ae322e7e71e
--- /dev/null
+++ b/src/tests/FunctionalTests/WebAssembly/Browser/RuntimeConfig/Program.cs
@@ -0,0 +1,24 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using System;
+using System.Runtime.CompilerServices;
+
+namespace Sample
+{
+ public class Test
+ {
+ public static void Main(string[] args)
+ {
+ Console.WriteLine ("Hello, World!");
+ }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ public static int TestMeaning()
+ {
+ var config = AppContext.GetData("test_runtimeconfig_json");
+ int result = ((string)config).Equals("25") ? 42 : 1;
+ return result;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/tests/FunctionalTests/WebAssembly/Browser/RuntimeConfig/WebAssembly.Browser.RuntimeConfig.Test.csproj b/src/tests/FunctionalTests/WebAssembly/Browser/RuntimeConfig/WebAssembly.Browser.RuntimeConfig.Test.csproj
new file mode 100644
index 00000000000000..4efa17aab45d9b
--- /dev/null
+++ b/src/tests/FunctionalTests/WebAssembly/Browser/RuntimeConfig/WebAssembly.Browser.RuntimeConfig.Test.csproj
@@ -0,0 +1,17 @@
+
+
+ true
+ WasmTestOnBrowser
+ 42
+ runtime.js
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/tests/FunctionalTests/WebAssembly/Browser/RuntimeConfig/index.html b/src/tests/FunctionalTests/WebAssembly/Browser/RuntimeConfig/index.html
new file mode 100644
index 00000000000000..9da181f4b3f091
--- /dev/null
+++ b/src/tests/FunctionalTests/WebAssembly/Browser/RuntimeConfig/index.html
@@ -0,0 +1,55 @@
+
+
+
+
+
+ TESTS
+
+
+
+
+
+ Result from Sample.Test.TestMeaning:
+
+
+
+
+
+
+
diff --git a/src/tests/FunctionalTests/WebAssembly/Browser/RuntimeConfig/runtime.js b/src/tests/FunctionalTests/WebAssembly/Browser/RuntimeConfig/runtime.js
new file mode 100644
index 00000000000000..b5227472674c6b
--- /dev/null
+++ b/src/tests/FunctionalTests/WebAssembly/Browser/RuntimeConfig/runtime.js
@@ -0,0 +1,39 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+var Module = {
+
+ config: null,
+
+ preInit: async function() {
+ await MONO.mono_wasm_load_config("./mono-config.json"); // sets Module.config implicitly
+ },
+
+ onRuntimeInitialized: function () {
+ if (!Module.config || Module.config.error) {
+ console.log("No config found");
+ test_exit(1);
+ throw(Module.config.error);
+ }
+
+ Module.config.loaded_cb = function () {
+ try {
+ App.init ();
+ } catch (error) {
+ test_exit(1);
+ throw (error);
+ }
+ };
+ Module.config.fetch_file_cb = function (asset) {
+ return fetch (asset, { credentials: 'same-origin' });
+ }
+
+ try
+ {
+ MONO.mono_load_runtime_and_bcl_args (Module.config);
+ } catch (error) {
+ test_exit(1);
+ throw(error);
+ }
+ },
+};
diff --git a/src/tests/FunctionalTests/WebAssembly/Browser/RuntimeConfig/runtimeconfig.template.json b/src/tests/FunctionalTests/WebAssembly/Browser/RuntimeConfig/runtimeconfig.template.json
new file mode 100644
index 00000000000000..e7cd22b984a40f
--- /dev/null
+++ b/src/tests/FunctionalTests/WebAssembly/Browser/RuntimeConfig/runtimeconfig.template.json
@@ -0,0 +1,6 @@
+{
+ "configProperties": {
+ "abc": "4",
+ "test_runtimeconfig_json": "25"
+ }
+}
\ No newline at end of file