Windows の Visual Studio で作成したコンソールアプリケーションを Visual Studio for Mac でデバッグ実行するとコンソールが表示されません。
これは各 Visual Studio でプロジェクトの作成時に生まれる .csproj ファイルに設定されている内容の違いによるようです。
■ Visual Studio for Mac の場合
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> <Optimize>false</Optimize> <OutputPath>bin\Debug</OutputPath> <DefineConstants>DEBUG;</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> <ExternalConsole>true</ExternalConsole> </PropertyGroup>
■ Visual Studio の場合
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PlatformTarget>AnyCPU</PlatformTarget> <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> <Optimize>false</Optimize> <OutputPath>bin\Debug\</OutputPath> <DefineConstants>DEBUG;TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup>
この
<ExternalConsole>true</ExternalConsole>
の有無の違いによるもので、Visual Studio で作成したプロジェクトに対して手動で .csproj ファイルに書き足せば Mac でもコンソールが開きます。
とても簡単ですね。