我几周来一直在努力解决这个错误,并且发现了类似的构建错误,但并不特定于mono.android
我正在使用 Microsoft Visual Studio Enterprise 2017 版本15.6.1 版本4.7.02556 NuGet Package Manager 4.6.0
Error Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'System.Runtime.InteropServices.PInvoke, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Perhaps it doesn't exist in the Mono for Android profile?File name: 'System.Runtime.InteropServices.PInvoke.dll'at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters) at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(DirectoryAssemblyResolver resolver, ICollection`1 assemblies, AssemblyDefinition assembly, Boolean topLevel)at Xamarin.Android.Tasks.ResolveAssemblies.Execute(DirectoryAssemblyResolver resolver) MyProject.Android
我在这里引用Mono 8。我有一堆不同的版本,甚至尝试过4.0.3和8.1。同样的错误。
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAAndroid\v8.0\Mono.Android.dll
我尝试过更新和删除一些nuget包 删除mono.android并定位另一个版本注释掉 app.config中的interop引用就像这些 针对其他api级别
PInvoke.BCryp,PInvoke.Kernel32,PInvoke.NCrypt,PInvoke.Windows.Core
上面的类似帖子但没有System.Runtime.Interopservices.Pinvoke.dll
请,任何建议都足够