zl程序教程

您现在的位置是:首页 >  后端

当前栏目

What's the replacement for fuslogvw in .net core 2?

NetCore for in The &# 39 What
2023-09-11 14:14:18 时间

What's the replacement for fuslogvw in .net core 2?

When encountering problems with resolving DLLs and assemblies in general with .Net fuslogvw gave you the ability to log the binding attempts so you could see exactly where it was looking and what was going on.

There is a github issue discussing this, but it's not exactly got very much detail on what COREHOST_TRACE actually provides, nor the best way to get the output, nor how to interpret the output.

So, is COREHOST_TRACE the best option?

If so how is it used?

If not, what's the better option?

I'd like to know the answer to this general question, because it's a useful tool to have and so has uses well beyond my current problem. However I am also trying to fix a specific problem, so I've included details of that below.

I'm using...

Interestingly the DLL is resolved when I publish a release build, but fails running locally for development builds.

Exception: System.DllNotFoundException: Unable to load DLL 'libwkhtmltox': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

The DLL in question is beinging copied to the root of the output directory:

<ItemGroup>
    <ContentWithTargetPath Include="Dependencies\wkhtmltox\v0.12.4\32 bit\libwkhtmltox.dll">
        <CopyToOutputDirectory>Always</CopyToOutputDirectory>
        <TargetPath>libwkhtmltox.dll</TargetPath>
    </ContentWithTargetPath>
</ItemGroup>

 

https://github.com/dotnet/runtime/issues/7693

下面2个命令都是cmd.exe里面执行
set COREHOST_TRACE=1
set COREHOST_TRACE_VERBOSITY=4
set COREHOST_TRACEFILE=host_trace.txt
dotnet run

https://github.com/dotnet/core-setup/blob/master/Documentation/design-docs/host-tracing.md

https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet#environment-variables

https://docs.microsoft.com/en-us/dotnet/core/dependency-loading/default-probing#how-do-i-debug-the-probing-properties-construction

 

https://github.com/dotnet/sdk/issues/6688

https://github.com/dotnet/sdk/issues/9594