C
C#2y 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
Pobiega2y ago
you can change the output directory when doing dotnet package/build if thats what you want?
MKP
MKP2y ago
If you were to do this, theres no guarantee that the executable will find the assemblies.
swagrid
swagrid2y 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
MKP2y ago
Perhaps you can fudge something by creating another csproj I'm not sure its possible
Pobiega
Pobiega2y 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
MKP2y ago
In any case you can have a post build script do the work
swagrid
swagrid2y 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
Pobiega2y ago
hm, yeah dunno if thats possible I at least do not know how it would be done