You can try using dotnet
to run your compiled dll or publish the app (via the UI or using dotnet publish
) providing architecture specific runtime identifier (RID) for example - win-x64
. Note the --self-contained
parameter which by default is true when RID is specified and the project is an executable one:
--sc|--self-contained [true|false]
Publishes the .NET runtime with your application so the runtime doesn't need to be installed on the target machine. Default is true
if a runtime identifier is specified and the project is an executable project (not a library project).
Which will lead to publishing all components of the app, including the .NET libraries and target runtime (see the corresponding docs). Set it to false
to publish framework-dependent executable, for example:
dotnet publish -r win-x64 --self-contained false
Also you can consider using publish profile files.