2

I am using .NET Standard Framework 4.7.2 for a simple console application. Is there a way to output all the necessary referenced dlls from the .NET Framework to the output folder so the user doesn't have to install the .NET Runtime on their machine?

Jim G.
  • 15,141
  • 22
  • 103
  • 166
  • 1
    No, a proper install is a rock-hard requirement. There are no machines left that don't have it, or can't [automatically update](https://stackoverflow.com/a/10033128/17034) themselves and run a 4.7.2 program, so nothing to fret about. – Hans Passant Oct 05 '22 at 00:14

1 Answers1

2

.NET 4.7.2? Out-of-the box? No.

But you can do this with .NET 6.


Here's a sample project file that specifies single file publishing:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net6.0</TargetFramework>
    <PublishSingleFile>true</PublishSingleFile>
    <SelfContained>true</SelfContained>
    <RuntimeIdentifier>win-x64</RuntimeIdentifier>
    <PublishReadyToRun>true</PublishReadyToRun>
  </PropertyGroup>

</Project>

Source

Jim G.
  • 15,141
  • 22
  • 103
  • 166