Closed Alex-Dobrynin closed 1 year ago
I don’t use Xamarin.Forms, could you provide a simple project with the problem?
You shouldn't use xam.forms, but your lib references System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
which is .net core library. In xamarin forms .netstandard2.0 is used, so it is incompatible to use your lib from .netstandard2.0 or higher project
We had problems with System.Private.CoreLib
but this wasn’t related directly by the lib we use (dnlib). Could you provide a sample?
It is very strange. In my test project it is working. but in my main project fails to compile. everything same, except few nuget packages. But if i downgrade your lib version to 2.8.12 it also works well. but upgrading to 2.9.x fails to compile. Something was broken in new version comparing to the old one
OK, it is happens when upgrading from 2.8.12 to 2.9.0-test1. with 2.8.12 works well, with 2.9.0-test1 cannot compile.
Also, I cloned your repo and mentioned that there are no netstandard tests written
We’ll give a try building for .net standard 2.0, then.
That previous post was stupid: there is no way to build a weaver in .net standard because this not an actual framework. Could you tell me which weaver is used? If it is the net5/6 we could make a try by forcing the weaving with the .net 4.6.1 weaver.
You probably have never created Xamarin projects. Core project is .netstandard2.x. and this is actualy a framework, because you can specify it as targetframework tag in .csproj file
Instead of writing non-sense (.net standard is NOT a framowork, it’s a standard), could you tell which weaver is used? 😉
just random screenshot from nuget
Could you tell which MrAdvice.Weaver.exe is used? (you still didn’t get it bout .net standard, but this is not the point)
BlankApp1.zip here is sample project, there you can figure out, that core project is .netstandard project and it cannot be built using your latest lib. if you remove all mentions of your lib it can be built successfully. I don't know which MrAdvice.Weaver.exe is used, I just installing nuget package
For your information on .net standard, please go read https://docs.microsoft.com/en-us/dotnet/standard/net-standard
But thank you for the sample which says:
MrAdvice 2.9.6/.NET 5.0 weaved module 'BlankApp1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' (targeting framework ) in 296ms
So I guess this was the .net 5.0 weaver 😉
.net5 is not supported by xamarin forms
That’s why I’ll try to use the .NET 4.6.1 weaver
.net framework also is not supported by xamarin. .net core 3.1 is supported
MrAdvice.Weaver 2.8 was only built in .NET framework. And is working for your case.
And it is strange. Could you provide .net core 3.1 version of your lib? or .netstandard2.0 For example, Prism library for xamarin forms provides their lib for .netstandard2.0 https://github.com/PrismLibrary/Prism/blob/master/src/Forms/Prism.Unity.Forms/Prism.Unity.Forms.csproj
Found the problem, you need to add this
netstandard2.0
here
and it will work in netstandard libs, tested in my project locally
https://www.nuget.org/packages/MrAdvice/2.9.9 Let me know!
After updating to version 2.9.2 I get this error Error Failed to resolve assembly: 'System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'
Xamarin.Forms 5, .netstandard2.1, c#9