dotnet run after project migration crashes dotnet
See original GitHub issueSteps to reproduce
- Install d15prerel\26130.0 with no workloads
- Install dotnet cli
- Download and extract Bala’s test repo
- In a prompt navigate to
\ProjectKTestProjects-master\Dev14_K101\Tooling202\ConsoleAppOnCore_1
- dotnet migrate
- dotnet restore - dotnet build - dotnet run
Expected behavior
The project starts running
Actual behavior
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)
Environment data
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
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
"dotnet has stopped working" StackOverflowException ...
I'm having a really annoying issue where every time I try to add a migration to my project, dotnet crashes and the migration...
Read more >NET applications crash at startup - .NET Framework
A user starts a .NET application. However, the application crashes at startup if the user.config file is corrupt. The application works fine ...
Read more >Visual Studio crashes when opening .net core solution ...
When monitoring the Task Manager, it seems that the crash occurs when MSBUILD is being executed. FYI: I'm trying to open this github...
Read more >VS2022 debugger crash with error Failed to read ...
I Have created a WPF App .NET Framework. Every time i try to debug, vs is crashing and I have all these event...
Read more >dotnet test command - .NET CLI
The dotnet test command is used to execute unit tests in a given project.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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 <path_to_your_app_dll>. Or, if it is a self-contained app, you simply invoke <your_app>.[exe].
@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.