Hello, I'm trying to add the .dlls required for monogame to work in an Android project. To add them I do the following:
References-> Edit References... -> .Net Assembly -> Add -> Ok
When I hit OK after selecting the .dll I want to use I get the following error:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065' or one of its dependencies. The system cannot find the file specified.
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection)
at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.ReflectionOnlyLoad(String assemblyString)
at IKVM.Reflection.Universe.DefaultResolver(String refname, Boolean throwOnError)
at IKVM.Reflection.Universe.Load(String refname, Module requestingModule, Boolean throwOnError)
at IKVM.Reflection.Reader.ModuleReader.ResolveAssemblyRefImpl(Record& rec)
at IKVM.Reflection.Reader.ModuleReader.ResolveAssemblyRef(Int32 index)
at IKVM.Reflection.Reader.ModuleReader.ResolveType(Int32 metadataToken, IGenericContext context)
at IKVM.Reflection.Module.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
at IKVM.Reflection.Module.ResolveType(Int32 metadataToken)
at IKVM.Reflection.Reader.ModuleReader.__GetReferencedTypes()
at MonoDevelop.MonoDroid.MonoDroidProject.<IsAssemblyCallingJavaCode>b__1(Module m)
at System.Linq.Enumerable.<SelectManyIterator>d__14
2.MoveNext()
at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext()
at System.Linq.Enumerable.Any[TSource](IEnumerable
1 source, Func2 predicate)
at MonoDevelop.MonoDroid.MonoDroidProject.IsAssemblyCallingJavaCode(String file)
at System.Linq.Enumerable.WhereArrayIterator
1.MoveNext()
at MonoDevelop.MonoDroid.MonoDroidProject.ValidateReference(XamarinEntitlements entitlements, ProjectReference reference)
at Xamarin.Ide.ActivationHelper.FindReferencesRequiringUpgrade(IXamarinProject project, XamarinEntitlements entl, List1 references, List
1& reasons, List1& delayedReferences)
at Xamarin.Ide.ActivationHelper.ReferenceValidator(Object sender, EditReferencesEventArgs e)
at MonoDevelop.Ide.ProjectOperations.AddReferenceToProject(DotNetProject project)
at MonoDevelop.Ide.Gui.Pads.ProjectPad.ProjectReferenceFolderNodeCommandHandler.AddReferenceToProject()
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at MonoDevelop.Components.Commands.DefaultCommandHandler.Run(Object target, Command cmd)
at MonoDevelop.Components.Commands.CustomCommandTargetAttribute.Run(Object target, Command cmd)
at MonoDevelop.Ide.Gui.Components.NodeCommandHandler.TransactedNodeHandlerAttribute.Run(Object target, Command cmd)
at MonoDevelop.Components.Commands.CustomCommandTargetAttribute.MonoDevelop.Components.Commands.ICommandTargetHandler.Run(Object target, Command cmd)
at MonoDevelop.Components.Commands.CommandHandlerInfo.Run(Object cmdTarget, Command cmd)
at MonoDevelop.Components.Commands.CommandManager.<>c__DisplayClassb.<DispatchCommand>b__2()
at MonoDevelop.Components.Commands.CommandManager.DispatchCommand(Object commandId, Object dataItem, Object initialTarget, CommandSource source)
I am running version 4.2.2 of Xamarin Studio, Thanks!