When I build my Visual C# Project, It generates not only .exe file but also .dll files which are referenced in this project. I tried to find where to turn on/off it, I couldn't find it. How can I stop generating ?
Asked
Active
Viewed 229 times
0
-
1I suspect you mean "why DLL are *copied* to output folder" ("generated" implies they are created from something else... which is unlikely the case). Also just to confirm - you do understand that you app is unlikely to work without those DLL and that exactly what you want, right? – Alexei Levenkov Jan 07 '20 at 23:22
-
When the reference is set to "copy local", the assemblies for that reference are added to the project output. Certain NuGet packages are also automatically added to the project output.If you want a single executable that has all of its dependencies baked in, you'll need to do some work. It's certainly not the default behavior. It depends on your .NET framework version and target platform how to accomplish that. Please add tags to this question accordingly. – jessehouwing Jan 07 '20 at 23:26
-
For .NET Core 3: https://dotnetcoretutorials.com/2019/06/20/publishing-a-single-exe-file-in-net-core-3-0/ – jessehouwing Jan 07 '20 at 23:27
-
For .NET 2-4: https://github.com/dotnet/ILMerge – jessehouwing Jan 07 '20 at 23:28
-
When to use Copy-Local: https://stackoverflow.com/a/2023968/736079 – jessehouwing Jan 07 '20 at 23:29
-
@AlexeiLevenkov Yes, Why DLL are copied to output folder ? My app is unlikely to work without those DLLs, but I embedded some xml code to App.config file for providing my app privatePath which DLL exists at. – devsophia Jan 07 '20 at 23:32
-
(resolved) I couldn't find where to set "copy local" property to true. right-click on dll in reference list inside solution explorer, click property, then you can find it. [where is "local copy" property](https://stackoverflow.com/questions/16200856/how-to-set-set-the-copy-local-property-to-true-in-visual-studio-2012/43270510) @AlexeiLevenkov Thanks. – devsophia Jan 08 '20 at 04:37