System.IO.FileNotFoundException: Could not load assembly...perhaps doesn't exist in the Mono for Android Profile?

StackOverflow https://stackoverflow.com/questions/22976760

  •  30-06-2023
  •  | 
  •  

Question

I am getting the following error when trying to compile my Android App from Visual Studio (I am using Xamarin plug in).

Error 2 Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'PresentationUI, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Perhaps it doesn't exist in the Mono for Android profile?

File name: 'PresentationUI.dll' at Xamarin.Android.Tuner.DirectoryAssemblyResolver.Resolve(AssemblyNameReference

reference, ReaderParameters parameters) at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(List`1

assemblies, AssemblyDefinition assembly, Boolean topLevel) at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(List`1

assemblies, AssemblyDefinition assembly, Boolean topLevel) at Xamarin.Android.Tasks.ResolveAssemblies.Execute()

I had a look around and found this forum post which looks like a similar problem. I couldn't find the PresentationUI.dll assembly tho.

Any suggestion on why am I getting this error and how to fix it?

Update

I found that the problem actually comes from using DelegateCommand from Microsoft.Practices.Prism.dll Is it because this assembly is not supported by Xamarin?

Cheers,

Était-ce utile?

La solution

PresentationUI is part of WPF (UI framework on Windows), which is not available on mobile platforms, such as Xamarin.Android.

You have to recreate a mobile compatible UI of your application so as to be Android ready.

Microsoft designs Prism to work with WPF, so yes you cannot use it in a Xamarin.Android project. (Prism latest build does work with Xamarin Forms though).

Reference: .NET Cross Platform UI Frameworks

Autres conseils

This exception means that in your mobile project somewhere in code you are using elements from PresentationUI that is WPF part and as mentioned above it can't be used in Xamarin.Android. Just review your code and make sure that you aren't using something from PresentationUI. Hope this will help.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top