Issue when exporting as Console for Linux (incorrect TargetFramework, OutputType, and RID)

Hi everyone,

I encountered an issue when exporting an application as a Console application for Linux / cross-platform.

Even though the export is intended for Linux, the generated build configuration still targets Windows with Windows Forms. It seems like the export settings for Windows.

The Problem

  1. Incorrect Target: The TargetFramework is set to net8.0-windows, but it should be net8.0 for Linux/cross-platform.
  2. Incorrect OutputType & UseWindowsForms: The OutputType is set to WinExe instead of Exe (which prevents a proper Console application from being created), and it includes <UseWindowsForms>true</UseWindowsForms>.
  3. Incorrect RID: The RuntimeIdentifier is set to win-arm64 instead of a Linux-compatible identifier (or none, depending on the target).

1. Generated Project File (.csproj snippet)

This is what the generated project file currently looks like:

<PropertyGroup>
  <TargetFramework>net8.0-windows</TargetFramework>
  <UseWindowsForms>true</UseWindowsForms>
  <OutputType>WinExe</OutputType>
  <RuntimeIdentifier>win-arm64</RuntimeIdentifier>
  <PublishDir>..\..\vvvvDemo</PublishDir>
  <AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
  <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
  <Platforms>AnyCPU;x64;x86</Platforms>
  <ApplicationManifest>App.manifest</ApplicationManifest>
  <ApplicationIcon>C:\Program Files\vvvv\vvvv_gamma_7.4-win-arm64\Resources\icons\vvvv_MAINICON.ico</ApplicationIcon>
</PropertyGroup>

2. Generated .props File (vvvvDemo.props)

The corresponding .props file is also incorrect for this configuration, as it still references Windows and ARM64 settings:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <VLAssetBehavior>RelativeToOutput</VLAssetBehavior>
    <VLCleanBuildDirectory>True</VLCleanBuildDirectory>
    <VLExportPath>$(MsBuildThisFileDirectory)</VLExportPath>
    <VLIgnoreCompileErrors>False</VLIgnoreCompileErrors>
    <VLIgnoreUnhandledExceptions>False</VLIgnoreUnhandledExceptions>
    <OutputType>Exe</OutputType>
    <PlatformTarget>AnyCPU</PlatformTarget>
    <TargetFramework>net8.0-windows</TargetFramework>
    <RuntimeIdentifier>win-arm64</RuntimeIdentifier>
  </PropertyGroup>
</Project>

Expected Behavior

For a Linux/Console build, the generated files should target cross-platform .NET 8.0:

  • <TargetFramework> should be net8.0 (without -windows).
  • <UseWindowsForms> should be removed or set to false.
  • <OutputType> should be Exe (for Console) / DLL (Linux)
  • <RuntimeIdentifier> should not be hardcoded to win-arm64.

Thank you very much for looking into this. Please let me know if you need any further information or tests.

hey jofo, in your screenshot you have the runtime identifier set to windows instead of linux:
image
does that explain it?

Thanks for the quick reply! It seems I made a mistake there, as I could have sworn I selected Linux. Thank you for helping me find the issue!