Quantcast
Channel: Xamarin.Mac — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 1429

How to resolve 'Could not load file or assembly ...

$
0
0

Hi

This question seem to pop often in the forum without any relevant answer. (at least I didn't find any to solve my problem)

I had a working mac app with legacy target + framework 4.7 libraries.

Now I'm trying to switch to a Mac app with the 'modern' target. So I migrated all my libraries to 'netstandard 2.0'.

I tried to cleans, manual deletes of obj/ and recreated my project from zero and copy my code into it.

I always get this error:

Loaded assembly: /c#/ExpenseLogMac/ExpenseLogMac/bin/Debug/Expense Log.app/Contents/MonoBundle/Expense Log.exe
Loaded assembly: /c#/ExpenseLogMac/ExpenseLogMac/bin/Debug/Expense Log.app/Contents/MonoBundle/MultiOSFileLoader.dll
Loaded assembly: /c#/ExpenseLogMac/ExpenseLogMac/bin/Debug/Expense Log.app/Contents/MonoBundle/netstandard.dll [External]
Loaded assembly: /c#/ExpenseLogMac/ExpenseLogMac/bin/Debug/Expense Log.app/Contents/MonoBundle/ExpenseCore.dll
Loaded assembly: /c#/ExpenseLogMac/ExpenseLogMac/bin/Debug/Expense Log.app/Contents/MonoBundle/Xamarin.Mac.dll [External]

Unhandled Exception:
System.TypeLoadException: Could not load type of field 'ExpenseCore.Db:dbConnection' (1) due to: Could not load file or assembly 'SQLiteNetStandard, Version=1.5.1.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. assembly:SQLiteNetStandard, Version=1.5.1.0, Culture=neutral, PublicKeyToken=null type:<unknown type> member:<none>
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: Could not load type of field 'ExpenseCore.Db:dbConnection' (1) due to: Could not load file or assembly 'SQLiteNetStandard, Version=1.5.1.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. assembly:SQLiteNetStandard, Version=1.5.1.0, Culture=neutral, PublicKeyToken=null type:<unknown type> member:<none>

If I compile a command line app, all is working fine. I'm not sure how I can resolve or understand this error.

Config: Visual Studio mac


Viewing all articles
Browse latest Browse all 1429

Trending Articles