runtime icon indicating copy to clipboard operation
runtime copied to clipboard

Common.Tests.sln not building

Open craigahanson opened this issue 11 years ago • 15 comments

I am having trouble building the Common.Tests solution file and I'm getting 2 errors about not being compatible with DNXCore (see screenshot) errors

craigahanson avatar Nov 11 '15 15:11 craigahanson

cc: @ericstj

stephentoub avatar Nov 11 '15 16:11 stephentoub

I looked at this before. It is a descrepency between the NuGet codebase and DNX. In DNX they have a hack to treat portable-net45+win8 as compatible with DNXCore50. That hack doesn't exist in NuGet. VS is using NuGetto try to restore the project.json and that is why it is failing. Let me file an issue on NuGet. Another fix would be for XUnit to either support DNXCore50 explicitly or with a dotnet folder. /cc @bradwilson.

ericstj avatar Nov 11 '15 17:11 ericstj

Given the comment here, I'm guessing aspnet doesn't want to port this to NuGet: https://github.com/aspnet/dnx/blob/8ddcfe9661188784fad37ea8d3b2965d3b4e756f/src/Microsoft.Dnx.Runtime/NuGet/Utility/VersionUtility.cs#L881-L895 /cc @davidfowl

ericstj avatar Nov 11 '15 17:11 ericstj

Thanks for the response.. What would you suggest be the best way for me to get it working?

craigahanson avatar Nov 11 '15 17:11 craigahanson

It still works using DNX. If you build first from the commandline (which is using DNX) it should work in VS. NuGet should see that the project.lock.json is up to date and not try to re-restore.

ericstj avatar Nov 11 '15 17:11 ericstj

This is a UWP tooling bug. My understanding is that it will eventually be fixed. The workaround is to uncheck DNXCore5.0 support in the PCL dialog. You will still actually be DNXCore5.0 compatible, and this bug goes away.

bradwilson avatar Nov 11 '15 19:11 bradwilson

Thanks Brad but how do I do that?.. I'm new to this ;-)

craigahanson avatar Nov 11 '15 19:11 craigahanson

Actually this is a little different. Brad, these are project.jsons that only target DNXCore50 but associated with CSProjs not xproj's it's a bit of an artificial scenario that existing customers don't hit with inbox templates. Today in XProj/DNX this specific package is only working because of the hack in DNX that I pointed out.

Given the comment in the DNX codebase you probably need to update XUnit if you want it to keep working in XProj/DNXCore50. @DavidFowl can correct me, but I bet they'll act on that TODO during RC2. Looking at the content of Xunit.Abstractions you could simply add a dotnet folder and put the same thing in there as the one in portable-net45+win8+wp8+...

ericstj avatar Nov 11 '15 19:11 ericstj

Thanks @ericstj but I'm still a little unsure with exactly what I need to do.. What directory would I need to add the sorbet folder to?

craigahanson avatar Nov 11 '15 21:11 craigahanson

Sorry I meant dotnet folder!

craigahanson avatar Nov 11 '15 22:11 craigahanson

@craigahanson if you just want to get corefx building, according to Eric's comment above it should work in VS if you build first from the commandline via build.cmd.

akoeplinger avatar Nov 11 '15 22:11 akoeplinger

Well @davidfowl and I have had rows on this before, but I believe that you are making a HUGE mistake if you don't automatically assume any System.Runtime-based PCL isn't already compatible with dnxcore50. This isn't just an xUnit.net problem, this is a general software ecosystem problem.

bradwilson avatar Nov 11 '15 23:11 bradwilson

@craigahanson can you try modifying the project.json to the following:

  "frameworks": {
    "dnxcore50": {
      "imports": "portable-net45+win8"
    }
  }

This should force NuGet to treat DNXCore50 as compatible with portable-net45+win8.

/cc @dagood

ericstj avatar Nov 12 '15 22:11 ericstj

Ping. If I don't hear back I will close this issue.

ericstj avatar Nov 24 '15 18:11 ericstj

I tested this and it worked for me. Closing this for now. Reopen if it doesn't work for you.

/cc @dagood who will be making similar changes across the repo as we switch to using nuget.exe instead of DNU.

ericstj avatar Nov 24 '15 18:11 ericstj