Skip to content

Assembly.Load does not find assembly in the application base directory #8045

@slozier

Description

@slozier

I tried the following:

Debug.Assert(File.Exists(Path.Combine(AppDomain.CurrentDomain.Base​Directory, "test2.dll")));
Assembly.Load("test2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null");

which results in a FileNotFoundException. Works fine with .NET Framework.

All the documentation I'm finding relates to the .NET Framework and says that Assembly.Load will do probing in the application base directory if it fails to find the assembly elsewhere. If .NET Core is supposed to behave differently is there some documentation outlining the differences?

I guess as a workaround I could use AssemblyResolve and implement the probing myself?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions