无法加载程序集System.Collections.Concurrent版本4.0.0.0

时间:2016-11-19 10:17:50

标签: c# xamarin

我是Xamarin的新手,所以我用Xamarin安装了Visual Studio,当我创建一个新项目,然后在没有做任何事情的情况下运行它会给我这样的错误

C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1410,2): error : Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'System.Collections.Concurrent, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Perhaps it doesn't exist in the Mono for Android profile?
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1410,2): error : File name: 'System.Collections.Concurrent.dll'
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1410,2): error :    at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters)
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1410,2): error :    at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(ICollection`1 assemblies, AssemblyDefinition assembly, Boolean topLevel)
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1410,2): error :    at Xamarin.Android.Tasks.ResolveAssemblies.Execute()

有什么问题?

1 个答案:

答案 0 :(得分:-1)

我运行此命令" Install-Package System.Collections.Concurrent"在包管理器控制台中。然后去添加引用,然后单击浏览,然后转到C: - > windows-> microsoft.net-> Framework64-> v4.0.30319 folder->选择system.colection.concurrent.dll->单击OK。