C
C#3y ago
swagrid

Change output directory of nuget package

Usually, nuget package assemblies and dependencies are copied to OutDir during build, e.g. bin\Debug\net6.0. Is it possible to 1. put all the assemblies and dependencies of a specific nuget package in a different folder (e.g. OutDir/sub) without having to fall back to manually Copy them in a target. 2. configure that output directory form within the nuget package itself (i.e. via some props or targets)
8 Replies
Pobiega
Pobiega3y ago
you can change the output directory when doing dotnet package/build if thats what you want?
Mkp
Mkp3y ago
If you were to do this, theres no guarantee that the executable will find the assemblies.
swagrid
swagridOP3y ago
@Pobiega I want to change the folder for the consumer of the packages. @MKP that's not an issue in this case, because this nuget package basically hosts its own runtime in a different process. In the end there are two different processes. One running in OutDir and the other in OutDir/sub
Mkp
Mkp3y ago
Perhaps you can fudge something by creating another csproj I'm not sure its possible
Pobiega
Pobiega3y ago
change the folder for the consumer of the packages.
I'm not sure I follow here. so If I make a program that uses your package, it should change my output directory? O_O?
Mkp
Mkp3y ago
In any case you can have a post build script do the work
swagrid
swagridOP3y ago
@MKP my colleague suggested the same, but I was hoping to find a different solution. @Pobiega only of this one nuget package, not the rest of the project
Pobiega
Pobiega3y ago
hm, yeah dunno if thats possible I at least do not know how it would be done
Want results from more Discord servers?
Add your server