Closed
Description
Description
Creating instance of AssemblyDependencyResolver throws exception "Hostpolicy must be initialized and corehost_main must have been called before calling corehost_resolve_component_dependencies" when native host uses Mscoree.h to load .NET 5 runtime.
Steps:
- Create host using https://docs.microsoft.com/en-us/dotnet/core/tutorials/netcore-hosting#create-a-host-using-mscoreeh as example.
- Run managed code using CreateDelegate approach.
- In .NET code create instance of AssemblyDependencyResolver.
Expected behavior: I believe during host initialization I provided enough information to allow AssemblyDependencyResolver work
Actual behavior: Exception is raised in corehost_resolve_component_dependencies
Configuration
- .NET preview 5, but I don't think there were any changes in preview 6.
- Windows 10
- Using x64 but I don't think it is specific to architecture