I've been experimenting with C# script (*.csx) to do some data processing with the results of service calls to some internal APIs. It's been pretty smooth thus far, but I'm now trying to call some methods from a C# project I have access to. The C# project doesn't have a published nuget package, which means referencing the dll directly using #r
. However in order to access the necessary functions, I've found I also need to add references to the top of my script for any of that projects dependencies and any nuget packages that dependency uses.
#r "PATH_TO_SOLUTION\Project\bin\Debug\netstandard2.0\binary.dll"
#r "PATH_TO_SOLUTION\ProjectDependency\bin\Debug\netstandard2.0\dependent.dll"
#r "nuget: Some.Dependency, 11.0.2"
#r "nuget: Some.Other.Dependency, 10.0.2"
#r "nuget: Some.Third.Dependency, 9.0.2"
using Project;
I'm new to the C# scripting world, and didn't find anything directly addressing this question so hopefully I'm not asking something super obvious here.
Some projects depend on a pretty large number of nuget packages, is there a way to reference a csproj from a C# script that doesn't require explicitly referencing all of the dependencies for the project?
Let me know if there's any additional information I can provide.