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

2

8

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)

Outbreak answered 9/7, 2013 at 19:59 Comment(1)
I'm receiving this error myself, did you ever manage to fix it? ThanksOlszewski
V
4

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.

Voltaire answered 2/9, 2013 at 11:58 Comment(5)
What is the GAC? It would be useful to clarify this to make this answer more useful.Tetrabrach
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.Voltaire
I'm receiving this error myself, can't seem to fix it, any other ideas/tips?Olszewski
More information about GAC would be very helpful. After adding the Xamarin dlls for System.Web I still have the problem. The problem emerged after I added the AWS resources to my working Xamarin project.Implantation
I found this worked for me: #17557597Merriment
P
8

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

Preliminaries answered 2/8, 2016 at 15:6 Comment(1)
Hey! The solution worked but gave another error stating: The "LinkAssemblies" task failed unexpectedly.... can you please help me with this?Yb
V
4

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.

Voltaire answered 2/9, 2013 at 11:58 Comment(5)
What is the GAC? It would be useful to clarify this to make this answer more useful.Tetrabrach
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.Voltaire
I'm receiving this error myself, can't seem to fix it, any other ideas/tips?Olszewski
More information about GAC would be very helpful. After adding the Xamarin dlls for System.Web I still have the problem. The problem emerged after I added the AWS resources to my working Xamarin project.Implantation
I found this worked for me: #17557597Merriment

© 2022 - 2024 — McMap. All rights reserved.