Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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)

like image 434
Boot750 Avatar asked Jul 09 '13 19:07

Boot750


2 Answers

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

like image 192
AKW Avatar answered Sep 20 '22 19:09

AKW


I had the same issue with System.Web. All I had to do was to add the System.Web reference from the GAC.

update

GAC is probably the wrong word here. Those are the default .net (mono) framework libraries. You can find them in Project/References/ and right click to 'Edit References' you'd find the framework libraries under Packages tab.

like image 25
Illuminati Avatar answered Sep 21 '22 19:09

Illuminati