❔ Help copying dependencies to output folder
Hey guys! I'm setting up some CI tools for myself and have run into the following issue:
I use ILRepack to pack all my dependencies into my distributed plugin. As it stands, I expect them to be in the output folder.
When I build my project from VS2022, all dependencies are copied to the output folder, as is standard practice for
.NET Framework
. However, if I build the same project with dotnet build
(using .NET 7.0.4
), that doesn't happen, and the usual method for doing so in .NET Standard / .NET Core / .NET 5+
(CopyLocalLockFileAssemblies
) doesn't work because this is a .NET Framework
project. I've explored upgrading my project to .NET Standard
, and will do so if I have to, but in testing I hit some compatibility issues that I'm not confident I'd be able to iron out in my large (to me ) project.
I need to build with dotnet build
for CI purposes, so... Either I bite the bullet and upgrade to .NET Standard 2.1
or find some way to locate dependency .dll
s when building from dotnet build
.
Anyone got any insight, or willing to sanity check me? <:ChillBar_pray:872511920119377941>17 Replies
I might just be stupid, but what about MSBuild scripts?
I promise I'm the stupid one
What did you have in mind? I'm not very familiar with msbuild scripts
all dependencies are copied to the output folder, as is standard practice for .NET Framework.Something like this right? You can specify DestinationFolder.
Ah. Something like that, but I'm missing dependencies from nuget as well. If there's a way I could learn of their location in an msbuild script I'm game
Where are your NuGets located?
Oh right, sorry.
Not a clue, unfortunately
Best info I can provide there is that I'm setting this up in github actions, so I'm relying on dotnet restore to restore them, and that's all I really know
You can do something like this.
Ahaaa, I seeee! I'll see what I can do with that
Actually, you shouldn't use PackagesDirectory.
It's a user defined macro.
Oop never mind then
Use
$(NuGetPackageRoot)
.NICE
Thank you
Common NuGet configurations
NuGet.Config files control NuGet's behavior, and can be modified with nuget config command.
This should be it.
Many thanks
I'll poke around with it when I get home tonight
👍
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.