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
- Incorrect Target: The TargetFramework is set to
net8.0-windows, but it should benet8.0for Linux/cross-platform. - Incorrect OutputType & UseWindowsForms: The
OutputTypeis set toWinExeinstead ofExe(which prevents a proper Console application from being created), and it includes<UseWindowsForms>true</UseWindowsForms>. - Incorrect RID: The
RuntimeIdentifieris set towin-arm64instead 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 benet8.0(without-windows).<UseWindowsForms>should be removed or set tofalse.<OutputType>should beExe(for Console) / DLL (Linux)<RuntimeIdentifier>should not be hardcoded towin-arm64.
Thank you very much for looking into this. Please let me know if you need any further information or tests.
