Open bodong1987 opened 1 year ago
i can't reproduce it even do everything exactly the same as the video, but after analyzing the project structure, but i guess here should be what things happened
TestConsole
and TestConsoleWithRef
are one with NetBeauty
and one without NetBeauty
ncbeauty
post build task, it will search every single *.deps.json
and *.runtimeconfig[.dev].json
and process them, so TestConsole
is beauty unexcpedly too.ncbeauty
injects a STARTUP_HOOK
calls nbloader
which will add a resolver to the default AssemblyLoadContext
.TestLibs
also adds a resolver to the current AppDomain
TestLibs
was loaded twice in somehowbtw:
the project structure is kind of wired, TestConsole
is trying to load the TestLibs
and TestLibs
is trying to load the TestPlugin
and TestPlugin
is referencing the TestLibs
.
ps:
NetBeauty
has the concept of project
since it is a msbuild task, but ncbeauty
hasn't unless treats every different *.deps.json
as a different project
, but this behaviour should treat as a BUG.
you can post a copy of debug build bins with pdb so i can have a deep look.
https://user-images.githubusercontent.com/9072328/223904381-0b1528ea-b4c7-4959-9d3f-31783faa25ae.mp4
MyTests.zip 1.TestLibs is a public library that is referenced by other projects. 2.TestPlugin, simulation plug-in dll, dynamic loading, direct reference to TestLibs
When running with TestConsole, you will see TestLibs.dll loaded twice. It's not clear to me if this is expected, if Assembly.LoadFile must be used to briefly reference TestLibs, is there a solution to this problem?