New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
netcoreapp3.0: Cannot run both Xamarin.Forms and Fody together in the same compilation unit #3508
Comments
Note, when I say "it works with netcore 2", I mean downgrading the Test project to netcoreapp2.2 and put the attached global.json in the solution folder. (Only downgrading to netcoreapp2.2 in the project still uses dotnet 3.0.100 if you have it installed, which has the same issue) |
i cant reproduce this it builds in both VS and dotnet cli
does it fail for you on a ci server (eg appveyor) or on a coworkers machine? |
It fails on my work and home machines, and a colleagues windows and mac environments and our ci server.
Did you try dotnet build on the test csproj and not on the solution directory as per the reproduction steps?
…--
Jahmai Lay
CTO
CriticalArc
W: www.criticalarc.com
E: jahmai@criticalarc.com
T: @criticalarc
P: +61 402 211 747
________________________________
From: Simon Cropp <notifications@github.com>
Sent: Tuesday, October 1, 2019 7:37:32 AM
To: dotnet/core <core@noreply.github.com>
Cc: Jahmai Lay <jahmai@criticalarc.com>; Author <author@noreply.github.com>
Subject: Re: [dotnet/core] netcoreapp3.0: Cannot run both Xamarin.Forms and Fody together in the same compilation unit (#3508)
i cant reproduce this
it builds in both VS and dotnet cli
PS C:\Downloads\FodyDotNet3> dotnet build --force
Microsoft (R) Build Engine version 16.3.0+0f4c62fea for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Restore completed in 164.81 ms for C:\Downloads\FodyDotNet3\FodyDotNet3\FodyDotNet3.csproj.
Restore completed in 761.89 ms for C:\Downloads\FodyDotNet3\FodyDotNet3.Test\FodyDotNet3.Test.csproj.
FodyDotNet3 -> C:\Downloads\FodyDotNet3\FodyDotNet3\bin\Debug\netstandard2.0\FodyDotNet3.dll
FodyDotNet3.Test -> C:\Downloads\FodyDotNet3\FodyDotNet3.Test\bin\Debug\netcoreapp3.0\FodyDotNet3.Test.dll
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:01.47
does it fail for you on a ci server (eg appveyor) or on a coworkers machine?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#3508?email_source=notifications&email_token=AAPK65OM3254MLE6YGISHUTQMJWRZA5CNFSM4I3WK4SKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD77FXVQ#issuecomment-536763350>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AAPK65IE3BZLRTZDQOON74TQMJWRZANCNFSM4I3WK4SA>.
|
sorry yep can repro now. can you try replacing
with
|
Still can reproduce with those lines. I tried adding to FodyDotNet3.csproj and to both FodyDotNet3.csproj/FodyDotNet3.Test.csproj with the same results. Note that to reproduce it you need to dotnet clean between builds because it builds after two attempts and then won't fail. |
EDIT: Scratch below comment - I can see I didn't strongly name the binaries. I made a new Xamarin.Forms package with a Xamarin.Forms.Build.Tasks.dll that referenced 0.11.0 of Mono.Cecil and the matching Mono binaries. The issue still occurred, but this time it couldn't find the newer version. This suggests the problem is not that there is multiple versions of Mono.Cecil being used since Fody and Xamarin.Forms were using the same version.
|
@livarcocc @nguerrera is this something you can help with? |
@jahmai can you try Fody version 6.0.4-beta.2 |
@SimonCropp Confirmed. 6.0.4 resolves this issue in our product code. Workarounds removed :) Thanks! |
@jahmai thanks for closing the loop. BTW fody relies on users being being patrons to ensure it can continue to be maintained https://github.com/Fody/Home#community-backed For anyone else who comes here. the problem was fody was using a |
netcoreapp3.0: Cannot run both Xamarin.Forms and Fody together in the same compilation unit
I don't know exactly where this issue resides, but it appears to be related to assembly resolution with netcore 3, since the issue doesn't happen with netcore 2.
Both Fody and Xamarin.Forms have a compilation step that uses Mono.Cecil. Currently the latest versions of both these packages use different versions of Mono.Cecil.
If you have a netstandard2.0 project with both Xamarin.Forms and Fody which is then referenced by a netcoreapp3.0 project (such as a unit test project), dotnet build fails with;
If you run it again, it will succeed. I suspect because one of the post-compile phases for Xamarin.Forms or Fody is done in the first run, and the other in the second.
General
VS 2019 16.3.1
.net core 3.0.100
See attached reproduction project. Just dotnet build the test project.
FodyDotNet3.zip
The text was updated successfully, but these errors were encountered: