NuGet puts dll files in root of bin folder!

Started by
4 comments, last by Dave Haylett 5 years, 10 months ago

Hi.

I have pulled in five NuGet packages for my Visual Studio 2017 project, however when I build the project, VS spits out 10 .DLL and .XML files in the root of the binary folder, to do with the packages. Can't I shove them into a \packages folder so the user doesn't see these ugly resources next to the .exe file?

I've Googled moving the packages but the only responses seem to be around moving the installation folder of the NuGet packages on the local machine, as opposed to where VS builds them to.

Advertisement

NuGet Packages usually bring class libraries, and these are always additional dlls. Visual Studio always copies all required references into the bin folder.

There are ways to embed assemblies (ILMerge) so you end up with one executable, but it's somewhat cumbersome. 

Fruny: Ftagn! Ia! Ia! std::time_put_byname! Mglui naflftagn std::codecvt eY'ha-nthlei!,char,mbstate_t>

Library files are managed by Visual Studio during development, in write-only automatically managed folders, like a project's "bin" and "obj", and normally never seen by the users in the installed end product (they're presumably going to use shortcuts, not to open your folder and look for an executable). So why do you find them so ugly that you are willing to spend time and effort hiding them? 

Omae Wa Mou Shindeiru

It looks like ILMerge is a bit nicer to use lately:  https://github.com/Microsoft/ILMerge

If I'm reading the last part right, you can perform ILMerge as a build step automatically.

Thanks for the responses all.

@LorenzoGatti My app doesn't have an installer package and so users would need to find the .exe themselves, at least for the first time. Yes, some of them will manually create a shortcut. I was just hoping for some setting in VS somewhere which I'd missed.

@Endurion @Nypyren I took a look at ILMerge but I don't think I'll use it, just in case it causes difficulties.

This topic is closed to new replies.

Advertisement