\ProjectKTestProjects-master\Dev14_K101\Tooling202\ConsoleAppOnCore_1
The project starts running
dotnet crashes
C:\Users\v-sccarl\Documents\ProjectKTestProjects-master\Dev14_K101\Tooling202\AspNetCoreWeb_IndAuth_WithAI_1>dotnet run
Unhandled Exception: System.InvalidOperationException: Couldn't find a project to run. Ensure a project exists in C:\Users\v-sccarl\Documents\ProjectKTestProjects-master\Dev14_K101\Tooling202\AspNetCoreWeb_IndAuth_WithAI_1.
Or pass the path to the project using --project
at Microsoft.DotNet.Tools.Run.RunCommand.Initialize()
at Microsoft.DotNet.Tools.Run.RunCommand.Start()
at Microsoft.DotNet.Tools.Run.RunCommand.<>c__DisplayClass0_0.<Run>b__0()
at Microsoft.DotNet.Cli.CommandLine.CommandLineApplication.Execute(String[] args)
at Microsoft.DotNet.Tools.Run.RunCommand.Run(String[] args)
at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, ITelemetry telemetryClient)
at Microsoft.DotNet.Cli.Program.Main(String[] args)
dotnet --info
output:
.NET Command Line Tools (1.0.0-rc4-004707)
Product Information:
Version: 1.0.0-rc4-004707
Commit SHA-1 hash: 5aded80a7b
Runtime Environment:
OS Name: Windows
OS Version: 10.0.14393
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\1.0.0-rc4-004707
@jonsequitur can you address this while fixing dotnet/sdk#7582?
Closing in favor of dotnet/sdk#7582.
@piotrpMSFT The change I made fixes this as well.
From visual studio 2017 in debug/release mode running but after publishing the project, these errors are occurring. Can anyone help me here please?
To run a published app you don't use dotnet run. Dotnet run is a development tool and you need to use it by specifying a csproj or by running it from a folder containing a csproj.
For published apps, if it is a portable app, you run it by doing dotnet
@livarcocc thanks for explanation, saved me from banging my head against the wall too much.
Just in case someone comes across this thread looking for an answer how to make it run on Azure App (and have limited ability to test publish before production publish). Correct me if I'm wrong, cause I kinda figured this out.
When you publish to Azure, you don't need to run anything, if you have this line in web.config:
<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false"/>
Upon publish, this line gets replaced with:
<aspNetCore processPath="dotnet" arguments=".\NameOfYourMainDLL.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
And in this way Azure webserver knows what to run when you request the website. Basically it becomes equivalent to running "dotnet NameOfYourMainDLL.dll" in console when you test publish locally.
That works for me @livarcocc Thanks.
Most helpful comment
To run a published app you don't use dotnet run. Dotnet run is a development tool and you need to use it by specifying a csproj or by running it from a folder containing a csproj.
For published apps, if it is a portable app, you run it by doing dotnet. Or, if it is a self-contained app, you simply invoke .[exe].