启动注册期间无法加载程序集"System.Runtime.Loader" [英] Could not load assembly 'System.Runtime.Loader' during startup registration

查看:682
本文介绍了启动注册期间无法加载程序集"System.Runtime.Loader"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用.NET Standard创建新的Xamarin.Forms项目时,安装Castle Windsor并在Android上运行该项目,它将失败,并出现以下错误

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.

当我打开Android项目的属性并更改到Sdk and User assemblies的链接时,该应用程序按预期运行.我以为该链接选项只能引入问题,因为某些代码不会包含在内,但可以解决.

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.

还有一点要注意,我之前从事的项目使用Reference,而新创建的项目将PackageReference用于nuget程序包.

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

更新:项目突然停止工作,删除Castle Windsor和/或更改链接选项无效.

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

我确实尝试过清除解决方案,nuget缓存并在不同设备上构建/运行项目.

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

推荐答案

移回packages.config nuget管理解决了该问题.

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

这篇关于启动注册期间无法加载程序集"System.Runtime.Loader"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆