0

In my csproj file, I have the following lines:

<OutputType>Exe</OutputType>
<TargetFramework>net461</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>

When building/publishing, a self-contained deployment is created with over 100 dll files. Most of them are System.*, but since I am targetting .NET 4.6.1 - these files should already be available on target machine where .NET 4.6.1 is installed.

Is it possible to deploy an exe file with just my referenced NuGet assemblies, just like the older Console App project types?

I am trying to mimick the output of older Desktop Console App project types, but with the new csproj format.

It was suggested this might be a possible duplicate of another similar question, but that question revolves around making the app run with just 1 file (which is not currently possible). Whereas my question is more about not putting unnecessary dll files in the output folder. I can remove all System.* files, and the app still runs perfectly fine, so I don't want them in my output folder.

Stephen Kennedy
  • 20,585
  • 22
  • 95
  • 108
Inrego
  • 1,524
  • 1
  • 15
  • 25
  • Note, that it works if I copy all files except System.* to target machine. But it would be nice to completely leave them out of the output. – Inrego Feb 15 '18 at 19:32
  • You fall into an area that Microsoft has no plan to support yet. So don't waste your time on that. – Lex Li Feb 15 '18 at 20:45
  • See [Is there a way to make a console application run using only a single file in .NET Core?](https://stackoverflow.com/q/44835273) – NightOwl888 Feb 15 '18 at 22:51
  • @StephenKennedy That's a slightly different question. I do expect my output to have my exe + all my referenced assemblies. That question is mostly to have just 1 file, removing the need of runtimeconfig and possibly merging .dll's into the exe. In my case, I just want it to leave out all the unnecessary files (the app works fine without them). – Inrego Feb 16 '18 at 17:31
  • @Inrego My mistake, sorry. I evidently didn't look at the other question closely enough. – Stephen Kennedy Feb 16 '18 at 17:33
  • @StephenKennedy No worries. But I did spend an hour or two trying to search for a solution, and had already come across and read that other question before posting my question :) – Inrego Feb 16 '18 at 17:37
  • This looks to be interesting https://github.com/aspnet/Configuration/issues/739 I hope that's a bit closer to your issue this time, but either way I shall see myself out :) – Stephen Kennedy Feb 16 '18 at 17:47

0 Answers0