Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running dotnet run on a console app has no output #23616

Closed
zigpot opened this issue Jan 26, 2022 · 4 comments
Closed

Running dotnet run on a console app has no output #23616

zigpot opened this issue Jan 26, 2022 · 4 comments
Assignees
Labels
Milestone

Comments

@zigpot
Copy link

zigpot commented Jan 26, 2022

I followed this tutorial https://dotnet.microsoft.com/en-us/learn/dotnet/hello-world-tutorial/run
Operating System: Debian GNU/Linux 11 (bullseye) amd64

image

As can be seen, running:

dotnet run

inside the project didn't output anything.

here is Program.cs:

using System;

namespace MyApp
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
        }
    }
}

and MyApp.csproj:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net5.0</TargetFramework>
  </PropertyGroup>

</Project>

Surely I can do

dotnet ./bin/Debug/net5.0/MyApp.dll

and it would run, but that isn't how it was in the tutorial

How can I run this simple program, specifically using

dotnet run

alone?

@mairaw mairaw transferred this issue from dotnet/core Jan 26, 2022
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-CLI untriaged Request triage from a team member labels Jan 26, 2022
@marcpopMSFT marcpopMSFT self-assigned this Feb 1, 2022
@marcpopMSFT marcpopMSFT added needs team triage Requires a full team discussion and removed untriaged Request triage from a team member needs team triage Requires a full team discussion labels Feb 2, 2022
@marcpopMSFT marcpopMSFT added this to the Discussion milestone Feb 2, 2022
@marcpopMSFT
Copy link
Member

@zigpot Does this repro with the 6.0.100 SDK and targeting net6.0? I can't reproduce this behavior on windows with either the 6.0 or 5.0 SDK so I'm not sure if it's specific to debian.

@zigpot
Copy link
Author

zigpot commented Feb 18, 2022

@marcpopMSFT I'm sorry, I haven't opened Github in a while.

This behaviour was not specific to Debian as my previous attempt in (if I recalled correctly) Ubuntu 20.04, yielded the same result. And just like you, I wasn't able to reproduce the problem on Windows.

Version 6.0.102 targeting net6.0 produces similar behavior, furthermore I specifically am avoiding using version 6 due to another issue I was also experiencing.

However, I have just installed via snap the latest/beta which happens to be dotnet SDK version 7.0.0, and the all the problems disappear.

@marcpopMSFT
Copy link
Member

Thanks for the detailed reply. Would you be able to try the recently released 6.0.200 version? It sounds like it affects linux but not windows and affects 6.0.102 but not 7.0.100. I'm just trying to narrow down where the issue might be.

@marcpopMSFT marcpopMSFT closed this as not planned Won't fix, can't repro, duplicate, stale Aug 2, 2022
@ckyleda
Copy link

ckyleda commented Sep 15, 2022

Why was this issue closed? It still exists. I can launch the project via the dll, but dotnet run simply terminates with no console output (aside from "using launchsettings.json"). This is for an ASPNET Core webapp. Using NET 3.1 on Ubuntu installed via Snap

Was there any solution discovered to this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants