Skip to content
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

Corefx build fails when Xamarin PCL profiles are installed #13989

Closed
dsplaisted opened this issue Jan 16, 2015 · 14 comments
Closed

Corefx build fails when Xamarin PCL profiles are installed #13989

dsplaisted opened this issue Jan 16, 2015 · 14 comments
Assignees
Labels
area-Infrastructure-libraries bug help wanted [up-for-grabs] Good issue for external contributors
Milestone

Comments

@dsplaisted
Copy link
Member

  1. Install Xamarin tools
  2. Build corefx

EXPECTED: Build succeeds
ACTUAL: Build fails with lots of type resolution errors

The ResolveNuGetPackages target is failing to resolve assets out of xunit.core.netcore:

C:\git\corefx\src\packages\Microsoft.DotNet.BuildTools.1.0.21-prerelease\lib\packageresolve.targets(25,5): warning : Unable to resolve the assets of xunit.core.netcore: Couldn't find a matching group

The Xamarin tools add XML files to the SupportedFrameworks folders of some PCL profiles. This results in the configured frameworks for the project to be:

.NETFramework,Version=v4.5;.NETCore,Version=v4.5;WindowsPhoneApp,Version=v8.1;WindowsPhone,Version=v8.0;MonoAndroid,Version=v1.0;MonoTouch,Version=v1.0

From the package, the following frameworks are supported:

.NETFramework,Version=v4.5;ASP.NetCore,Version=v5.0;.NETCore,Version=v4.5;WindowsPhoneApp,Version=v8.1;WindowsPhone,Version=v8.0

So since the package doesn't support MonoTouch and MonoAndroid, the build system isn't resolving any of the assemblies inside it.

@terrajobst
Copy link
Member

Shouldn't this be closed? It seems dotnet/buildtools#51 fixed this?

@dsplaisted
Copy link
Member Author

@terrajobst No, dotnet/buildtools#51 doesn't fix this. It just allows the workaround of changing the extension of the Xamarin .xml files so that they'll be ignored.

@trydis
Copy link

trydis commented Jan 29, 2015

I'm experiencing the same, 339 warnings and 1038 errors when building from the command line.

@AlexSikilinda
Copy link

Is there a workaround for this? I tried changing the extensions of Xamarin xmls but it didn't work as for me. Will uninstalling Xamarin help?

@dsplaisted
Copy link
Member Author

@AlexSikilinda Changing the extensions for the Xamarin .xml files in the PCL Profile SupportefFrameworks folders worked for me after dotnet/buildtools#51 was merged. However, I haven't tested this recently. It's also possible that you missed renaming some of them.

@citizenmatt
Copy link

If anyone else hits this, the workaround is to look for any Xamarin.*.xml files under %ProgramFiles%\Reference Assemblies\Microsoft\Framework\.NetPortable. They'll be in several ProfileX\SupportedFrameworks folders, and should be deleted, moved or renamed so that they don't end in .xml.

@xen2
Copy link
Contributor

xen2 commented Apr 26, 2015

Note: this also happens on coreclr:

Starting the Managed Tests Build

  Restoring all package dependencies...
C:\DEV\dotnet\coreclr\tests\src\packages\Microsoft.DotNet.BuildTools.1.0.21-prerelease\lib\packageresolve.targets(25,5): warning : Unable to resolve the assets of System.Diagnostics.Process: Couldn't find a matching group [C:\DEV\dotnet\coreclr\tests\src\Common\Coreclr.TestWrapper\Coreclr.TestWrapper.csproj]
(some more warning like this)
CSC : error CS0518: Predefined type 'System.Object' is not defined or imported [C:\DEV\dotnet\coreclr\tests\src\Common\Coreclr.TestWrapper\Coreclr.TestWrapper.csproj]

@ghuntley
Copy link
Member

ghuntley commented May 1, 2015

Yep, stumbled upon this today whilst working on dotnet/corefx#921

  1. dotnet/coreclr@master on a fresh/clean checkout.
  2. Visual Studio 2015 RC developer prompt on a laptop that has Xamarin installed.
  3. build.cmd
  4. before
  5. uninstall xamarin_._

after

@bpschoch
Copy link
Contributor

bpschoch commented May 3, 2015

I had the same thing happen to me after updating to the visual studio 2015 RC version selecting all defaults (which I didn't realize selected Xamarin). I didn't find the files mentioned in the workaround so I went to add/remove and removed Xamarin and it fixed the problem.

Probably need to update developers instructions (Next to using Visual Studio 2015 RC) to make sure not to install Xamarin when installing this latest version to spare others from this side-trip I made.

@kzu
Copy link
Contributor

kzu commented May 22, 2015

Guys, I'd love to solve this once and for all. What are we doing wrong that this doesn't "just work"? Installing our .xml files under the SupportedFrameworks for various profiles is the way this has to be done for it to work for installing nuget packages as of NuGet 2.8.

Is this something that changed again on the MS/PCL side? Just to be clear: anything that is .NET 4.5 is compatible pretty much as-is with Xamarin.iOS and Xamarin.Android, since we are a full .NET 4.5 profile anyway (plus the platform-specific APIs).

So, how to we tell "the build system" that in a reliable way that works without workarounds that work on one version of VS and break in another? ;) (since removing those XMLs most certainly break the installation of those nuget packages that target net45 or profile78/others onto XA/XI projects... )

@DickvdBrink
Copy link
Contributor

Ping, would love to see this issue fixed before the final release, (be it on the Xamarin side or VS side).
I think alot of people will run into this issue. Anything I can do to help diagnose this?

(edit btw, see this just as a question not an attack on anyone :) )

@kzu
Copy link
Contributor

kzu commented May 28, 2015

We need clear guidance on how to extend PCLs for NuGets in a way that works
for users as well as this project. Disabling all nuget compatibility for
Xamarin should not be the answer ;)

On Thu, May 28, 2015 at 4:27 PM Dick van den Brink [email protected]
wrote:

Ping, would love to see this issue fixed before the final release, (be it
on the Xamarin side or VS side).
I think alot of people will run into this issue. Anything I can do to help
diagnose this?

Reply to this email directly or view it on GitHub
https://github.com/dotnet/corefx/issues/449#issuecomment-106572328.

@kzu
Copy link
Contributor

kzu commented Apr 22, 2016

Hey @dsplaisted has there been any further investigation on why our PCL XML files would break this scenario? It seems to happen in non-CoreCLR cases too (i.e. just got a report from a MS guy, @victorgarciaaprea can point to, who got the error in a blank PCL Xamarin.Forms app).

@mellinoe
Copy link
Contributor

mellinoe commented Nov 7, 2016

It's been a while since there was last activity on this. Since we've changed our build configuration significantly since this was filed, I'm going to close this. Please file a new issue if there's something similar.

@mellinoe mellinoe closed this as completed Nov 7, 2016
Olafski referenced this issue in Olafski/corefx Jun 15, 2017
Remove dotnet bot from contributor list
@msftgits msftgits transferred this issue from dotnet/corefx Jan 31, 2020
@msftgits msftgits added this to the 2.0.0 milestone Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Jan 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Infrastructure-libraries bug help wanted [up-for-grabs] Good issue for external contributors
Projects
None yet
Development

No branches or pull requests