Build/Test Issues

project using project.json can't find `system.net.http`

Started by moswald on 9,378 views

This is the entire project.json file:

{
  "dependencies": {
    "System.Collections.Immutable": "1.2.0",
    "System.Net.Http": "4.0.0"
  },
  "frameworks": {
    "net461": {}
  },
  "runtimes": {
    "win": {},
    "win-x64": {} 
  }
}


It builds fine in VS2015, and it builds fine using our Cake build script on the build server. However, NCrunch fails when building:

Http\XHeaderProviderHandler.cs (3, 22): The type or namespace name 'Http' does not exist in the namespace 'System.Net' (are you missing an assembly reference?)
Http\XHeaderProviderHandler.cs (15, 51): The type or namespace name 'DelegatingHandler' could not be found (are you missing a using directive or an assembly reference?)
Http\XHeaderProviderHandler.cs (28, 64): The type or namespace name 'HttpRequestMessage' could not be found (are you missing a using directive or an assembly reference?)
Http\XHeaderProviderHandler.cs (28, 33): The type or namespace name 'HttpResponseMessage' could not be found (are you missing a using directive or an assembly reference?)
Http\XHeaderProviderHandler.cs (28, 54): 'XHeaderProviderHandler<TValue>.SendAsync(HttpRequestMessage, CancellationToken)': no suitable method found to override


If it matters, the project is x64 only.
Hi,

Support for .NET Core isn't here yet with NCrunch unfortunately. Although the release of the tooling for this a week ago now makes it possible for NCrunch to support this, some development is still required. Likely it will be available in January.
Hrm. This isn't a .NET Core library, though. It's just using `project.json` as the nuget source. I thought at one point this was working, but maybe I'm misremembering.
moswald wrote:Hrm. This isn't a .NET Core library, though. It's just using `project.json` as the nuget source. I thought at one point this was working, but maybe I'm misremembering.


Ahh, sorry. I misunderstood. Does a restore packages and rebuild work correctly? Does the project build correctly under NCrunch in VS2015?

There haven't been any significant steps in NCrunch to support project.json. But if this was something that used to work but no longer works, then it may warrant some investigation.
It restores and builds properly from within VS2015, but NCrunch 3 does not build it. I'm fairly certain this project was working fine under v2.4, but I'll have to wait until tomorrow to test that out.
moswald wrote:It restores and builds properly from within VS2015, but NCrunch 3 does not build it. I'm fairly certain this project was working fine under v2.4, but I'll have to wait until tomorrow to test that out.


Thanks. I'm keen to hear how this goes.
Yes, NCrunch 2.4 builds the project properly, but 3.1 does not.
moswald wrote:Yes, NCrunch 2.4 builds the project properly, but 3.1 does not.


Thanks for confirming this. I'll look into this on my side to see what I can find. Can you confirm that the project.json file is copied into the NCrunch workspace?

Edit: Is it also possible for you to share a sample project that can reproduce this problem? With a basic Nuget project.json setup on my side, NCrunch seems to be building correctly.

Edited

Post a reply

Log in to reply.