严重性 代码 说明 项目 文件 行 禁止显示状态
错误 Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'Xamarin.Android.Support.v7.AppCompat, Version=1.0.0.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?
文件名:“Xamarin.Android.Support.v7.AppCompat.dll”
在 Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters)
在 Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(DirectoryAssemblyResolver resolver, ICollection`1 assemblies, AssemblyDefinition assembly, Boolean topLevel)
在 Xamarin.Android.Tasks.ResolveAssemblies.Execute(DirectoryAssemblyResolver resolver) ToolbarFun
经对比发现应该是vs的bug,当创建了 Forms ContentView后就一直报这个错误,对比发现只要删除 .csproj 文件中的下面这段,即可以解决此问题:
<Reference Include="Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..packagesXamarin.Forms.2.3.3.193libMonoAndroid10Xamarin.Forms.Core.dll</HintPath> </Reference> <Reference Include="Xamarin.Forms.Platform, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..packagesXamarin.Forms.2.3.3.193libMonoAndroid10Xamarin.Forms.Platform.dll</HintPath> </Reference> <Reference Include="Xamarin.Forms.Platform.Android, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..packagesXamarin.Forms.2.3.3.193libMonoAndroid10Xamarin.Forms.Platform.Android.dll</HintPath> </Reference> <Reference Include="Xamarin.Forms.Xaml, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..packagesXamarin.Forms.2.3.3.193libMonoAndroid10Xamarin.Forms.Xaml.dll</HintPath> </Reference>