I've just migrated a (WPF) .NET 4.6 project to .NET 5.
I've noticed it is now creating a folder called 'runtimes' in the output directory with lots of platform-dependent dlls.
Since this app will only run on Windows machines, is there anyway of preventing these folders being created during a build in Visual Studio?
That's pretty easy to change: In your csproj file, inside the PropertyGroup, set the SelfContained property to "false" and specify a RuntimeIdentifier; like this:
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<SelfContained>false</SelfContained>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
</PropertyGroup>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With