You have to convert it to a .NET Standard Class Library, https://blog.lextudio.com/which-class-library-project-to-go-in-visual-studio-2015-2017-a48710cf3dff
Using NetCore 3.1 Class library in Xamarin
Hello Everyone,
We have a very big class library which is developed using netcore 3.1
We can perfectly communicate with other desktop apps using this API and now We want to support mobile devices too.
We are using Xamarin netstandard 2.0. We can add reference to our dll file with no error but when the mobile application starts running it throws this exception if any method in dll is called in the app:
System.TypeLoadException: 'Could not resolve type with token 0100004b from typeref (expected class 'System.Threading.Tasks.Task' in assembly 'System.Runtime, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a')'
But it doesnt throw an exception if the dll is added to project but not used.
We tried to switch to net 5 but didnt work out.
How can I solve this issue?
thanks.
-
Lex Li (Microsoft) 4,742 Reputation points Microsoft Employee
2021-11-04T05:45:18.67+00:00