When I build the App in Release mode in Visual Studio it generates these files in Release folder:
App.exe
App.dll
App.runtimeconfig.json
App.pdb
App.deps.json
App.runtimeconfig.dev.json
If I move the first 3 files location and double click the App.exe it starts. If I delete App.runtimeconfig.json it doesn't start!
I want to keep only App.exe and App.dll in my folder, what do I have to do to get rid of that App.runtimeconfig.json?
EDIT #1
Here's the content of App.runtimeconfig.json:
{
"runtimeOptions": {
"tfm": "netcoreapp3.0",
"framework": {
"name": "Microsoft.WindowsDesktop.App",
"version": "3.0.0"
}
}
}
EDIT #2
Here's what I've now in my App.csproj file's PropertyGroup:
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>netcoreapp3.0</TargetFramework>
<PublishTrimmed>true</PublishTrimmed>
<PublishReadyToRun>true</PublishReadyToRun>
<PublishSingleFile>true</PublishSingleFile>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<UseWPF>true</UseWPF>
</PropertyGroup>
now I get this in Error List of Visual studio:
Error NETSDK1047 Assets file 'C:\Users\Emon\source\repos\SocketTest\App\obj\project.assets.json' doesn't have a target for '.NETCoreApp,Version=v3.0/win-x64'. Ensure that restore has run and that you have included 'netcoreapp3.0' in the TargetFrameworks for your project. You may also need to include 'win-x64' in your project's RuntimeIdentifiers. App C:\Program Files\dotnet\sdk\3.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets 234
When I right click on Project I see: Build, Clean, Rebuild, etc., there's no restore!
EDIT #3
I've deleted the bin and obj folders first and reordered the <PropertyGroup> to put the <RuntimeIdentifier> beneath the <TargetFramework>, now it works!