-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AssemblyLoadContext: Loading of assemblies from 'runtimes' folder #13015
Comments
From the traces I've attached to the initial post, I found out that in case of the published version the rid fallback graph is empty. I think this could be a reason for |
This is a known problem with the component loading in self-contained apps. The master issue is here: https://github.com/dotnet/core-setup/issues/6961. In your case you're specifically hitting https://github.com/dotnet/core-setup/issues/6960. Unfortunately I'm currently not aware of a good workaround. The only one I can think of is to add some code into your |
thank you for response are you going to fix those issues before netcore 3 release? |
I don't think it will happen - the one you're hitting we might be able to as it's just an SDK change, doesn't require fixes in the host or the runtime. The other will very likely not happen as it requires changes both in SDK and the host. |
well, one more possible solution is the publishing of plugin with an explicit platform. Some what like -r win-x64. |
@vitek-karas you asked me here(https://github.com/dotnet/coreclr/issues/13277) to create a new issue. here it is.
In short:
My plugin application has a dependency from System.Diagnostics.PerformanceCounter.dll. I publish it as
dotnet publish -f netcoreapp3.0
The issue is that if I just build my loader and start it, it loads plugin application without any issues. It takes a version of the library from
runtimes
folder.if I publish Loader application like 'dotnet publish -f netcoreapp3.0 -r win-x64' (it is important that I use RID 'win-x64', not 'win10-x64') it loads System.Diagnostics.PerformanceCounter.dll assembly from the plugin application folder. And this version is generating an exception that platform is not supported.
I've checked the trace file for failure case and found out that it can not load from runtimes folder because RID win10-x64 is not compatible with platform 'win' where System.Diagnostics.PerformanceCounter.dll is situated.
runtimes\win\lib\netcoreapp2.0\System.Diagnostics.PerformanceCounter.dll
to be precise. I do not see such message for NotPublished versionEDIT:
trace snippet for published version
trace snippet for non published version
difference is this line:
End of EDIT
What do I do wrong? What should I do to get it working correctly? I need a version of my application which may run on windows, on linux, and on mac.
here is netcore info:
here are links to trace files and to sample application:
Loader app sample: https://www.dropbox.com/s/lqragpd26vfccr2/Loader.7z?dl=0
it contains Loader - app, Application - the plugin, AppInterfaces - common interface lib.
'_out' folder which contains 'dev' folder with build results and 'publish' folder with results of publishing.
trace_p.7z(https://www.dropbox.com/s/vfwbzgfoyqf4umb/trace_p.log.7z?dl=0) - zipped version of trace for the version from 'publish' folder
trace.7z(https://www.dropbox.com/s/613qu1n8wy5a3rv/trace.log.7z?dl=0) - zipped version of trace for the version from 'dev' folder
to start dev version you may use visual studio. to start published version you have to go to '_out/publish/Loader' folder and start Loader.exe
The text was updated successfully, but these errors were encountered: