Reputation: 73
Can we use "dotnet run" or any other cli command for running ASPnet Core application without project files and only with binaries in my local machine(not server), configs and executables.
my application is in AspnetCore 2.2 and .netframework 4.6.1
So I have the binaries, and I want to run the application using those binaries and I do not have the project files or solution file with projects.
I know this is possible as few-many years back I had done it using Visual studio 2015 exe, but thru command line or so and ran the application using only binaries, just that it was .Net framework application, And I forgot how I did it.
My application is also configured to run using IIS Express, so I would also appreciate if I get to know if I could run using binaries with IIS using CLI.
Upvotes: 1
Views: 6209
Reputation: 900
Yes, this is possible.
You can always use the help:
dotnet --help
Usage: dotnet [runtime-options] [path-to-application] [arguments]
...
path-to-application:
The path to an application .dll file to execute.
Which describes its usage as:
dotnet your.file.dll
EDIT 1:
The *.runtimeconfig.dev.json
usually has the following contents:
{
"runtimeOptions": {
"additionalProbingPaths": [
"C:\\Users\\USERNAME\\.dotnet\\store\\|arch|\\|tfm|",
"C:\\Users\\USERNAME\\.nuget\\packages",
"C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder"
]
}
}
Note: you need to replace USERNAME with your own username.
and the *.runtimeconfig.json
:
{
"runtimeOptions": {
"tfm": "netcoreapp2.2",
"framework": {
"name": "Microsoft.AspNetCore.App",
"version": "2.2.0"
},
"configProperties": {
"System.GC.Server": true
}
}
}
Upvotes: 3