Xamarin build error Exception while loading assemblies: System.IO.FileNotFoundException

Boot750 picture Boot750 · Jul 9, 2013 · Viewed 14.4k times · Source

always i try to Build my Xamarin app i get this error. And i dont know why. I use the System.Security.dll of .Net Framework 4 and i though this should work. Thanks.

C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2,2): Error: Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'System.Security, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Perhaps it doesn't exist in the Mono for Android profile?

Dateiname: 'System.Security.dll'

bei Xamarin.Android.Tuner.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters)

bei Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(List`1 assemblies, AssemblyDefinition assembly)

bei Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(List`1 assemblies, AssemblyDefinition assembly)

bei Xamarin.Android.Tasks.ResolveAssemblies.Execute() (TaskManager2)

Answer

AKW picture AKW · Aug 2, 2016

Add the missing .dll to your project(s).

Right click on the References folder -> Add Reference -> Browse -> C:\Windows\Microsoft.NET\Framework64\<version number>\ -> <missing.dll>

Clean your project and rebuild