When calling Assembly.Location, it is expected to return the absolute path of the assembly. In wasm, only the assembly name itself is returned.
For example:
// say SomeClass exists in Foo.dll
string path = typeof(SomeClass).Assembly.Location;
Assembly assembly = Assembly.LoadFile(path);
Path will return Foo.dll instead of the expected /Foo.dll and Assembly.LoadFile will throw an exception because path is not absolute.
The primary problem is wasm is that we load the runtime assemblies from a byte array. We take this approach to speed up the loading process and skip loading the assemblies into the VFS.
Tagging subscribers to this area: @CoffeeFlux
Notify danmosemsft if you want to be subscribed.
We take this approach to speed up the loading process and skip loading the assemblies into the VFS.
Are the assemblies actually present in the VFS? If not, Assembly.Location should return empty string.
Most helpful comment
Are the assemblies actually present in the VFS? If not,
Assembly.Locationshould return empty string.