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

Tool restore without proper imports silently fails. #2462

Closed
NTaylorMullen opened this issue Apr 5, 2016 · 7 comments
Closed

Tool restore without proper imports silently fails. #2462

NTaylorMullen opened this issue Apr 5, 2016 · 7 comments
Assignees
Labels
Milestone

Comments

@NTaylorMullen
Copy link

I have a tool (aspnet/RazorTooling) that utilizes Newtonsoft.Json. Currently Newtonsoft.Json's package does not have the proper TFMs for the RazorTooling project to understand without imports. If I happen to make a mistake in my project.json and forget to include an import that works with Newtonsoft.Json I do not get an error on restore. Instead in my deps.json file Newtonsoft.Json is listed as: "Newtonsoft.Json/8.0.3": {} (wrong) which then causes runtime failures whenever I attempt to use the tool (couldn't load Newtonsoft.Json or one of its dependencies).

Tool restore should fail the same as non-tool restore ex:

Errors in C:\Users\nimullen\Documents\GitHub\Mvc\samples\TagHelperSample.Web\project.json
    Package Newtonsoft.Json 8.0.3 is not compatible with netstandardapp1.5 (.NETStandardApp,Version=v1.5). Package Newtonsoft.Json 8.0.3 supports:
      - net20 (.NETFramework,Version=v2.0)
      - net35 (.NETFramework,Version=v3.5)
      - net40 (.NETFramework,Version=v4.0)
      - net45 (.NETFramework,Version=v4.5)
      - portable-dnxcore50+net45+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=net45+wp80+win8+wpa81+dnxcore50)
      - portable-net40+sl5+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile328)
    Package System.Collections.Immutable 1.1.37 is not compatible with netstandardapp1.5 (.NETStandardApp,Version=v1.5). Package System.Collections.Immutable 1.1.37 supports:
      - dotnet (.NETPlatform,Version=v5.0)
      - portable-net45+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile259)
    One or more packages are incompatible with .NETStandardApp,Version=v1.5.

/cc @pakrym

@brthor
Copy link

brthor commented Apr 6, 2016

I have noticed this as well with dotnet-compile-fsc

@brthor
Copy link

brthor commented Apr 6, 2016

@NTaylorMullen It might be more helpful to look at the lock file entry for your tool rather than the deps.json since deps.json is a cli generated artifact.

The lock file should be right next to the deps.json.

@joelverhagen
Copy link
Member

/cc @davidfowl

So what we're saying is that if a dependency of a tool or the tool itself is not compatible with netstandardapp1.5 plus imports, dotnet restore should fail in the same way as a normal (non-tool) restore would fail?

@NTaylorMullen
Copy link
Author

Correct.

@joelverhagen
Copy link
Member

@NTaylorMullen, this fix should be in .NET CLI right now. Could you verify that this issue is resolved?

@NTaylorMullen
Copy link
Author

@joelverhagen confirmed with 002416.

@joelverhagen
Copy link
Member

Thanks!

@rrelyea rrelyea modified the milestones: Future-1, 4.0 RC Oct 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants