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

余生长醉 提交于 2019-12-19 18:23:06

问题


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,


回答1:


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




回答2:


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.



来源:https://stackoverflow.com/questions/22976760/system-io-filenotfoundexception-could-not-load-assembly-perhaps-doesnt-exist

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!