Xamarin.forms 无法加载程序集';System.Runtime.Loader';在启动注册期间

Xamarin.forms 无法加载程序集';System.Runtime.Loader';在启动注册期间,xamarin.forms,xamarin.android,castle-windsor,Xamarin.forms,Xamarin.android,Castle Windsor,使用.NET标准创建新的Xamarin.Forms项目时,请安装Castle Windsor,并在Android上运行该项目,该项目将失败,并出现以下错误 D/Mono ( 5829): Assembly Loader probing location: 'System.Runtime.Loader'. F/monodroid-assembly( 5829): Could not load assembly 'System.Runtime.Loader' during startup re

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

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和用户程序集
时,应用程序按预期运行。我认为链接选项只会带来一些问题,因为有些代码不会被包括在内,但它解决了这个问题

另外,需要注意的一点是,我之前处理的项目使用
Reference
,而新创建的项目使用
PackageReference
作为nuget包

更新:项目突然停止工作,删除
温莎城堡
和/或更改链接选项无效


我确实尝试过清除解决方案、nuget缓存以及在不同的设备上构建/运行项目。

返回到
packages.config
nuget management解决了这个问题