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

Support for NuGet package.config and/or package restore for references. #32

Open
CZEMacLeod opened this issue Jul 5, 2016 · 3 comments

Comments

@CZEMacLeod
Copy link

I have a script which requires Newtonsoft.Json - In my case it is also used by the project that contains the script but this should not be a pre-requisite.
At the moment I am using #r "..\\bin\\Debug\\Newtonsoft.Json.dll" but this obviously only works after the build has been done once and not on a CI server. I am not currently using the project's packages path as if I update the package it will break the script.
I suggest that either a local packages.config gets parsed and restored relative to the script and using that, or a pre-processing of the csx occurs to replace package references with dll references.
e.g. #r "{Newtonsoft.Json}" -> #r "C:\\...\\packages\\Newtonsoft.Json.8.0.3\\lib\\net45\\Newtonsoft.Json.dll" assuming that there is a packages.config entry or MSBuild ItemGroup or other mechanism to define <package id="Newtonsoft.Json" version="8.0.3" targetFramework="net452" />

@daveaglick
Copy link
Owner

I totally agree - this would be really helpful. I was hoping it was on the roadmap for native Roslyn scripting functionality, and it looks like it is, but not until 2.0. Since we don't know when that's due, I may have to add it directly (for now). I'm going to see if I can get some feedback on what the Roslyn implementation will look like and copy that so we can rip it out of Scripty once it's in Roslyn.

@daveaglick
Copy link
Owner

For reference, (I think) this is being tracked as dotnet/roslyn#6900

@DamianReeves
Copy link

DamianReeves commented Sep 12, 2016

Maybe you can look at how cake does their nuget directive

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants