From 91172631147f7f1521113d2ad293986556ae8b9f Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Mon, 11 Dec 2017 19:18:19 +0000 Subject: [PATCH] Load .NET assemblies from the ReferencedAssemblyFileProvider only --- samples/MonoSanity/wwwroot/loader.js | 16 ++-------------- .../src/Platform/Mono/MonoPlatform.ts | 19 +++++-------------- .../ClientFilesystem/ClientFileProvider.cs | 1 - 3 files changed, 7 insertions(+), 29 deletions(-) diff --git a/samples/MonoSanity/wwwroot/loader.js b/samples/MonoSanity/wwwroot/loader.js index d391c30bbb..85e52e46d9 100644 --- a/samples/MonoSanity/wwwroot/loader.js +++ b/samples/MonoSanity/wwwroot/loader.js @@ -48,23 +48,11 @@ 'mscorlib', 'System', 'System.Core', - 'Facades/netstandard', - 'Facades/System.Console', - 'Facades/System.Collections', - 'Facades/System.Diagnostics.Debug', - 'Facades/System.IO', - 'Facades/System.Linq', - 'Facades/System.Reflection', - 'Facades/System.Reflection.Extensions', - 'Facades/System.Runtime', - 'Facades/System.Runtime.Extensions', - 'Facades/System.Runtime.InteropServices', - 'Facades/System.Threading', - 'Facades/System.Threading.Tasks' + 'System.Runtime' ]; var allAssemblyUrls = loadAssemblyUrls - .concat(loadBclAssemblies.map(function (name) { return '_framework/bcl/' + name + '.dll'; })); + .concat(loadBclAssemblies.map(function (name) { return '_framework/_bin/' + name + '.dll'; })); Module.FS_createPath('/', 'appBinDir', true, true); allAssemblyUrls.forEach(function (url) { diff --git a/src/Microsoft.Blazor.Browser/src/Platform/Mono/MonoPlatform.ts b/src/Microsoft.Blazor.Browser/src/Platform/Mono/MonoPlatform.ts index f1b18ef09a..e3093eaa82 100644 --- a/src/Microsoft.Blazor.Browser/src/Platform/Mono/MonoPlatform.ts +++ b/src/Microsoft.Blazor.Browser/src/Platform/Mono/MonoPlatform.ts @@ -133,27 +133,18 @@ function createEmscriptenModuleInstance(loadAssemblyUrls: string[], onReady: () mono_string_get_utf8 = Module.cwrap('mono_wasm_string_get_utf8', 'number', ['number']); mono_string = Module.cwrap('mono_wasm_string_from_js', 'number', ['string']); + // TODO: Stop hard-coding this list, and instead automatically load whatever + // dependencies were detected in ReferencedAssemblyFileProvider const loadBclAssemblies = [ 'mscorlib', 'System', 'System.Core', - 'Facades/netstandard', - 'Facades/System.Console', - 'Facades/System.Collections', - 'Facades/System.Diagnostics.Debug', - 'Facades/System.IO', - 'Facades/System.Linq', - 'Facades/System.Reflection', - 'Facades/System.Reflection.Extensions', - 'Facades/System.Runtime', - 'Facades/System.Runtime.Extensions', - 'Facades/System.Runtime.InteropServices', - 'Facades/System.Threading', - 'Facades/System.Threading.Tasks' + 'System.Console', + 'System.Runtime', ]; var allAssemblyUrls = loadAssemblyUrls - .concat(loadBclAssemblies.map(name => `_framework/bcl/${name}.dll`)); + .concat(loadBclAssemblies.map(name => `_framework/_bin/${name}.dll`)); Module.FS_createPath('/', 'appBinDir', true, true); allAssemblyUrls.forEach(url => diff --git a/src/Microsoft.Blazor.Server/ClientFilesystem/ClientFileProvider.cs b/src/Microsoft.Blazor.Server/ClientFilesystem/ClientFileProvider.cs index b4514c23e4..2788717999 100644 --- a/src/Microsoft.Blazor.Server/ClientFilesystem/ClientFileProvider.cs +++ b/src/Microsoft.Blazor.Server/ClientFilesystem/ClientFileProvider.cs @@ -13,7 +13,6 @@ namespace Microsoft.Blazor.Server.ClientFilesystem public static IFileProvider Instantiate(Assembly clientApp) => new CompositeFileProvider( MonoStaticFileProvider.JsFiles, - MonoStaticFileProvider.BclFiles, // TODO: Stop serving these, and serve the ReferencedAssemblyFileProvider instead BlazorBrowserFileProvider.Instance, new ReferencedAssemblyFileProvider(clientApp, MonoStaticFileProvider.BclFiles)); }