Could not load assembly 'System.Runtime.Loader' during startup registration

两盒软妹~` 提交于 2020-01-03 02:22:12

问题


When you create new Xamarin.Forms project using .NET Standard, install Castle Windsor and run the project on Android it will fail with the following error

D/Mono    ( 5829): Assembly Loader probing location: 'System.Runtime.Loader'.
F/monodroid-assembly( 5829): Could not load assembly 'System.Runtime.Loader' during startup registration.
F/monodroid-assembly( 5829): This might be due to an invalid debug installation.
F/monodroid-assembly( 5829): A common cause is to 'adb install' the app directly instead of doing from the IDE.

When I opened properties of the Android project and changed linking to Sdk and User assemblies the application ran as expected. I thought the linking option can only introduce problems as some codes won't be included, yet it fixes it.

Also, one thing to note, the previous project I worked on uses Reference whereas the newly created project uses PackageReference for nuget packages.

UPDATE: The project suddenly stopped working, removing Castle Windsor and/or changing linking options had no effect.

I did try clearing solution, nuget cache and building/running the project on different devices.


回答1:


Moving back to packages.config nuget management fixed the problem.



来源:https://stackoverflow.com/questions/48752827/could-not-load-assembly-system-runtime-loader-during-startup-registration

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!