Runtime: [Wasm] Assembly.Location does not return the full path

Created on 20 Jul 2020  路  2Comments  路  Source: dotnet/runtime

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.

arch-wasm area-AssemblyLoader-mono

Most helpful comment

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.

All 2 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

btecu picture btecu  路  3Comments

bencz picture bencz  路  3Comments

omariom picture omariom  路  3Comments

nalywa picture nalywa  路  3Comments

aggieben picture aggieben  路  3Comments