Load .NET assemblies from the ReferencedAssemblyFileProvider only
This commit is contained in:
parent
3b01daf15a
commit
9117263114
|
|
@ -48,23 +48,11 @@
|
||||||
'mscorlib',
|
'mscorlib',
|
||||||
'System',
|
'System',
|
||||||
'System.Core',
|
'System.Core',
|
||||||
'Facades/netstandard',
|
'System.Runtime'
|
||||||
'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'
|
|
||||||
];
|
];
|
||||||
|
|
||||||
var allAssemblyUrls = loadAssemblyUrls
|
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);
|
Module.FS_createPath('/', 'appBinDir', true, true);
|
||||||
allAssemblyUrls.forEach(function (url) {
|
allAssemblyUrls.forEach(function (url) {
|
||||||
|
|
|
||||||
|
|
@ -133,27 +133,18 @@ function createEmscriptenModuleInstance(loadAssemblyUrls: string[], onReady: ()
|
||||||
mono_string_get_utf8 = Module.cwrap('mono_wasm_string_get_utf8', 'number', ['number']);
|
mono_string_get_utf8 = Module.cwrap('mono_wasm_string_get_utf8', 'number', ['number']);
|
||||||
mono_string = Module.cwrap('mono_wasm_string_from_js', 'number', ['string']);
|
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 = [
|
const loadBclAssemblies = [
|
||||||
'mscorlib',
|
'mscorlib',
|
||||||
'System',
|
'System',
|
||||||
'System.Core',
|
'System.Core',
|
||||||
'Facades/netstandard',
|
'System.Console',
|
||||||
'Facades/System.Console',
|
'System.Runtime',
|
||||||
'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'
|
|
||||||
];
|
];
|
||||||
|
|
||||||
var allAssemblyUrls = loadAssemblyUrls
|
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);
|
Module.FS_createPath('/', 'appBinDir', true, true);
|
||||||
allAssemblyUrls.forEach(url =>
|
allAssemblyUrls.forEach(url =>
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ namespace Microsoft.Blazor.Server.ClientFilesystem
|
||||||
public static IFileProvider Instantiate(Assembly clientApp)
|
public static IFileProvider Instantiate(Assembly clientApp)
|
||||||
=> new CompositeFileProvider(
|
=> new CompositeFileProvider(
|
||||||
MonoStaticFileProvider.JsFiles,
|
MonoStaticFileProvider.JsFiles,
|
||||||
MonoStaticFileProvider.BclFiles, // TODO: Stop serving these, and serve the ReferencedAssemblyFileProvider instead
|
|
||||||
BlazorBrowserFileProvider.Instance,
|
BlazorBrowserFileProvider.Instance,
|
||||||
new ReferencedAssemblyFileProvider(clientApp, MonoStaticFileProvider.BclFiles));
|
new ReferencedAssemblyFileProvider(clientApp, MonoStaticFileProvider.BclFiles));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue