As soon as DevExpress XPOCore (https://www.nuget.org/packages/DevExpress.Xpo) is referenced in my XamarinForms application iOS refuses to build - All other platforms build fine. (Android and UWP)
I must add this issue is apparent when building to my iPad and with the simulator.
All packages selected are latest stable.
I am using the lastest community edition of Visual Studio on windows, which connects to a Mac Mini running the latest macOS (Mojave)
The issue is also apparent when I try to build the DevExpress demos - https://github.com/DevExpress/XpoNetCoreDemos
As XPO is a free nuget package - I can not ask DevExpress directly for support. What I have found is something remotely similar, but it did not help much - https://www.devexpress.com/Support/Center/Question/Details/T643780/xpo-core-system-drawing-common-filenotfoundexception-in-xamarin-android
The error message return in visual studio is -
Failed to resolve "System.Drawing.Image" reference from
"System.Drawing.Common, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=cc7b13ffcd2ddd51" DevExpress.Xpo.XamarinFormsDemo.iOS
C:\Program Files (x86)\Microsoft Visual
Studio\2017\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets
From output
1> C:\Program Files (x86)\Microsoft VisualStudio\2017\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(795,3):
error MT2002: Failed to resolve "System.Drawing.Image" reference from
"System.Drawing.Common, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=cc7b13ffcd2ddd51"
1>
1> 2 Warning(s)
1> 1 Error(s)
Edit - checked on Mac in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/Facades - and System.Drawing.Common exists already.
Edit - will build and run on simulator on automatic provisioning, but will not build with manual provisioning to a physical iPad connected to the mac, however other applications do. (that do not use XPO) (get same error as described above on all apps using XPO on iOS)
Edit - It works (builds) in the simulator - when using Automatic provisioning, as soon as you set the provisioning to manual and set a valid provisioning profile (from the mac) and try to deploy to a device (iPad) I am unable to build, with the error listed above.
It seems the Xamarin Linker does not add all required dependencies.
In the iOS Build tab, in the project settings, set the Linker Behavior property to 'Link All'
This allowed the application to be deployed to a iOS device.
Related
used uno-check to install all the needed prerequisites.
after this i have installed the Uno Platform dotnet templates :
dotnet new -i Uno.ProjectTemplates.Dotnet
and created a new project with this command :
dotnet new unoapp-winui -o MyUnoApp
who give me some errors about failed restoration (MSBUILD : error MSB1009 - project file not exist -)
After that i load the solution in visual studio (2019/2022), select MyUnoApp.Windows.Desktop as starting project (x86) and start the debug session but i got this error:
An unhandled exception of type 'System.DllNotFoundException' occurred in UNO.Windows.Desktop.dll
Unable to load DLL 'Microsoft.ui.xaml.dll' or one of its dependencies
Any hint?
I had the exact same problem, but after fiddling around a bit I found a solution.
Set the '.Windows.Package' project as startup instead of '.Windows.Desktop'
Also make sure you are have the same Platform selected for both Package and Desktop project.
It's my understanding that MyUnoApp.Windows.Desktop is the building target for the Windows desktop, whereas MyUnoApp.Windows.Package is the building target for the UWP app (pls correct me if I'm wrong). Hence, the original poster still would not have the problem of being unable to build the desktop app - which is the same problem I'm facing right now.
I would like to implement Push Notification function so installed Microsoft.Azure.NotificationHubs in Visual Studio. However, there is version error prompt out when I launched my software in debug mode:
FileLoadException: Could not load file or assembly 'System.Net.Http, Version=4.0.0.0, Culture=neutral
You didn't mention what framework you were using. I was able to create a console .NET 4.6.1 console app and was able to debug without issue. Since you are getting a FileLoadException, I would suggest using fuslogvw to see why the binary isn't being loaded. The notification hub package may replace the System.Net.Http NETFX version with it's own version, in which case you could remove the package and add it back.
I have implemented UrbanAirShip as it is given in this document. It is version 5.0.2. After implement it, I am getting following error while build in AppCenter.
MTOUCH : error MT2101: Can't resolve the reference 'System.Void
ObjCRuntime.BlockLiteral::SetupBlockUnsafe(System.Delegate,System.Delegate)',
referenced from the method 'UrbanAirship.UAAction
UrbanAirship.UAAction::Action(UrbanAirship.UAActionBlock)' in
'Xamarin.iOS, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=84e04ff9cfb79065'
If I remove UrbanAirship or keep older version, it builds successfully.
I have contacted with AppCenter and I got following reply from them.
You are building with mono 5_4_1, I’ve seen such errors in the past
when you have dependencies that require 5.8+ mono. Please try building
with the latest mono version in the build configuration pane. If it
still fails please let us know.
According to their reply, I have tried to find way where to change version of Mono in Build Configuration. But I didn't find in Visual Studio 2017 in Windows.
Can anybody please guide me what should I do now? If I need to upgrade Mono version, how can I update it?
I am trying to learn how to develop apps for UWP for both Desktop and Mobile. I have been currently working on getting the Entity Framework working in my app to store application state and followed the following link:
https://learn.microsoft.com/en-us/ef/core/get-started/uwp/getting-started
It worked well for Desktop, the issue however is that when I try to run it on the Windows Mobile emulator I get the following error in debug mode when the code reaches the db.Database.Migrate() step:
Unable to load DLL 'sqlite3': The specified module could not be found
In the link I pasted above, someone else had the same issue and in the comments they recommended to try the following:
Step 1: Install SQLite VSIX pacakge for Universal Windows Platform development using Visual Studio 2015
https://www.sqlite.org/2016/sqlite-uwp-3130000.vsix
Step 2: Install NuGet package SQLite.NET-PCL
Install-Package SQLite.NET-PCL
Step 3: Add references
Add Reference -> Universal Windows ->Extensions -> Make sure the following packages have been checked: "SQLite for Universal Windows Platform" "Visual C++ 2015 Runtime for Universal Windows Platform Apps"
After that, if you get the error "Payload contains two or more files with the same destination path 'sqlite3.dll', do the following:
copy sqlite3.dll from
C:\Program Files (x86)\Microsoft SDKs\UAP\v0.8.0.0\ExtensionSDKs\SQLite.UAP.2015\3.8.11.1\Redist\Debug\ARM\sqlite3.dll
past to (override it)
C:\Users\%USERNAME%\.nuget\packages\SQLitePCL.raw_basic\0.7.1\build\native\sqlite3_dynamic\winrt81\arm\sqlite3.dll
The problem after doing those steps is that I am now seeing the issue when doing a build for "Payload contains two or more files" however not in the SQLitePCL.raw_basic directory (I don't even seem that have that). Instead my error is the following:
Payload contains two or more files with the same destination path 'sqlite3.dll'. Source files:
C:\Users\admin\.nuget\packages\SQLite\3.13.0\runtimes\win7-x86\native\sqlite3.dll
C:\Program Files (x86)\Microsoft SDKs\UAP\v0.8.0.0\ExtensionSDKs\SQLite.UWP.2015\3.13.0\Redist\Debug\x86\sqlite3.dll
I have been searching everywhere and am truly stumped as to how to get my UWP program working on Mobile. Thanks a lot for your help!
It seems like you got the solution for resolving the exception The specified module could not be found from #Leandro_Medeiros_Machado 's comment on this document. If you got the Payload contains two or more files with the same destination path 'sqlite3.dll' exception after you done the above three steps you may be also found the next solution from the comment.
After that, if you get the error "Payload contains two or more files with the same destination path 'sqlite3.dll', do the following:copy sqlite3.dll from
C:\Program Files (x86)\Microsoft SDKs\UAP\v0.8.0.0\ExtensionSDKs\SQLite.UAP.2015\3.8.11.1\Redist\Debug\ARM\sqlite3.dll
past to (override it)
C:\Users\%USERNAME%\.nuget\packages\SQLitePCL.raw_basic\0.7.1\build\native\sqlite3_dynamic\winrt81\arm\sqlite3.dll
For you, you may need to copy from
C:\Program Files (x86)\Microsoft SDKs\UAP\v0.8.0.0\ExtensionSDKs\SQLite.UWP.2015\3.13.0\Redist\Debug\x86\sqlite3.dll to(override) C:\Users\admin\.nuget\packages\SQLite\3.13.0\runtimes\win7-x86\native\sqlite3.dll.
But actually, for using EF core you don't need the above steps and I recommend you check your environment instead of using the above workaround. I created a simple EF project by following the document and without install the VSIX I can run successfully on the emulator (build 10586). My VS build is 2015 update 3, my OS version is build 14393 and the EF core version is Microsoft.EntityFrameworkCore.Sqlite 1.1.0. So please firstly check if your environment met the following requirements:
Windows 10
Visual Studio 2015 Update 3
The latest version of Windows 10 Developer Tools
And if your EF core and EF core tools versions are right.
Currently, I am trying to retarget my windows store app to windows 8.1 preview. The problem is, that I used sqlite-net package in one of my project. I followed steps described here:
http://www.lyalin.com/2013/07/09/sqlite-for-windows-runtime-for-windows-8-1-apps/ and downloaded pre-release version of sqlite visual studio extension from this link:
http://www.lyalin.com/2013/07/09/sqlite-for-windows-runtime-for-windows-8-1-apps/.
I have added a reference to a newly installed sqlite for windows runtime in my project, but I got an error while building:
Error 2 Windows Runtime type 'Windows.Foundation.Point' was found in
multiple referenced winmd files. Please remove either 'C:\Program Files (x86)\Microsoft
SDKs\Windows\v8.1\ExtensionSDKs\Microsoft.VCLibs\12.0\References\CommonConfiguration\neutral\platform.winmd'
or 'C:\Program Files (x86)\WindowsKits\8.1\References\CommonConfiguration\Neutral\Windows.winmd'
from the list of referenced files. C:\Users\Jarosław\Desktop\BCM\Win8Client\MetriceModel\WINMDEXP
MetriceModel (Windows 8.1)
Somewhere, on one of the forums somebody hinted, that if you remove reference to microsoft visual c++ runtime package from the project, it will solve the problem. After I did that whole solution compiled fine, but I got a following exception at runtime:
Unable to load DLL 'sqlite3': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Exception is thrown at a line:
#if NETFX_CORE
SQLite3.SetDirectory(/*temp directory type*/2, Windows.Storage.ApplicationData.Current.TemporaryFolder.Path);
#endif
of SQLite.cs file (file is from mentioned earlier sqlite-net package).
Project's folder bin/Debug/AppX contains file sqlite3.dll. Every project in my solution has x86 as a platform target. How do I fix this issue? Before migrating the project everything worked fine.
You must install the official version of vsix package on sqlite download page (v3.8.0.2).
In the Visual Studio Add-in manager, this package version is 3.7.1.17 and it's not correct.
After, i think it is a bug, you have to select the good processor (platform target).
I had the same error because I deployed a migrated winrt application (8.1) compiled in x86 on a x64 machine...
=> in windows 8.0 it works, but not in windows 8.1.
If you have a x64 machine you have to select the x64 target compilation. I hope it will be fixed in futur...
can you please re-install the preview of SQLite for WinRT 8.1? There was an issue with the initial package, but we worked with them to update. http://sqlite.org/download.html
If you have an exception with
SQLite3.SetDirectory(/*temp directory type*/2,windows.Storage.ApplicationData.Current.TemporaryFolder.Path);
Check if your project uses x86 and not any CPU