Running the console app
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 30/100
Research direction
Start by reproducing the failure with dotnet run from the project directory and compare it with running the .csproj through Visual Studio 2019. Investigate why the command-line entry point reports Win32Exception (5), then confirm that the documented command works or that a clear non-IDE workaround is available.
Written by the indexing model from the issue text.
Description
Problem encountered on https://dotnet.microsoft.com/learn/dotnet/hello-world-tutorial/run
Operating System: windows
using Powershell ISE in Admin mode, I get this:
> PS F:\net6\myapp> dotnet run
dotnet : System.ComponentModel.Win32Exception (5): Access is denied.
At line:1 char:1
+ dotnet run
+ ~~~~~~~~~~
+ CategoryInfo : NotSpecified: (System.Componen...cess is denied.
:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo
startInfo)
at System.Diagnostics.Process.Start()
at Microsoft.DotNet.Cli.Utils.Command.Execute(Action`1 processStarted)
at Microsoft.DotNet.Cli.Utils.Command.Execute()
at Microsoft.DotNet.Tools.Run.RunCommand.Execute()
at Microsoft.DotNet.Tools.Run.RunCommand.Run(String[] args)
at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, TimeSpan
startupTime, ITelemetry telemetryClient)
at Microsoft.DotNet.Cli.Program.Main(String[] args)
Using the default command line in admin mode, I get this:
F:\>cd net6\myapp
F:\net6\myApp>dotnet run
System.ComponentModel.Win32Exception (5): Access is denied.
at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at Microsoft.DotNet.Cli.Utils.Command.Execute(Action`1 processStarted)
at Microsoft.DotNet.Cli.Utils.Command.Execute()
at Microsoft.DotNet.Tools.Run.RunCommand.Execute()
at Microsoft.DotNet.Tools.Run.RunCommand.Run(String[] args)
at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, TimeSpan startupTime, ITelemetry telemetryClient)
at Microsoft.DotNet.Cli.Program.Main(String[] args)
F:\net6\myApp>
BUT, Using VS 2019 (Version 16.9.4), after opening the .csproj file, and running the project, I get this:
Hello World!
F:\net6\myApp\bin\Debug\net6.0\myApp.exe (process 17640) exited with code 0.
To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops.
Press any key to close this window . . .
The web instructions state that I should get the result that came with using VS 2019, from the regular commandline, run in the project directory, but this fails. Is this known Issue? If yes, is there a workaround that does not involve the IDE?
- Dominant language
- C#
- Stars
- 3.2k
- Forks
- 1.3k
- Avg merge
- 4d 1h
- Merged PRs (30d)
- 235
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dotnet/sdk
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Re-enable ItCanTestAMultiTFMProjectWithImplicitRestore after MSBuild revert (msbuild#14349) flows in Openuntriaged
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Area-dotnetup untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
:watch: Not Triaged 11.0 fundamentals/subsvc
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
dotnet/AspNetCore.Docs#37699 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SubtitleEdit/subtitleedit#15108 · 1 comment ·
-
area/docs-content Bug pulumi/docs
Difficulty 1/5 1-3 hours Newbie friendliness 94/100
-
agentic-workflows untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 76/100