Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

Is it possible to add a nuget package as runtime only dependency?

$
0
0

I'm working with the following projects:

  • MyFramework.csproj (class library)

  • MyCustomerApp.csproj (class library)

    References MyFramework

  • MyLauncher.csproj (Executable program)

    references MyLauncherDependency.nupkg

MyCustomerApp.csproj is the 'runnable' project which works like so:

  1. MyLauncher.exe is copied from the MyLauncher project to the output of MyCustomerApp
  2. When running MyLauncher.exe, this uses Assembly.Load(..) to load the MyCystomerApp.dll

There's a specific reason as to why we have this mechanism which I won't get into - consider it out of scope for now.

Now here's the problem; MyLauncherDependency is a dependency of MyLauncher, but its not a dependency of MyCustomerApp. Therefore MyLauncherDependency is not a compile time dependency of MyCustomerApp - but it is a runtime dependency - because it needs MyLauncherDependency.dll at runtime.

I don't want to add MyLauncherDependency.nupkg to MyCustomerApp because I don't want to give engineers access to classes from MyLauncherDependency in MyCustomerApp.

So my question is: How can I add MyLauncherDependency.nupkg (or MyLauncherDependency.nupkg) to MyCustomerApp as a runtime only dependency?


Viewing all articles
Browse latest Browse all 3067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>