Skip to content

Error compiling project on Debian linux: error NETSDK1100: Windows is required to build Windows desktop applications. #19

@ndbroadbent

Description

@ndbroadbent

Hello,

I would like to be able to modify and compile the code on my Debian Linux server, or on my Macbook.

I installed the latest Mono on Debian from here: https://www.mono-project.com/download/stable/#download-lin-debian
I also followed these instructions to install the .NET SDK:

sudo apt-get install -y dotnet-sdk-5.0

Then I ran msbuild in the project directory. Here's the output:

root@debian-server:/opt/HTFanControl# msbuild
Microsoft (R) Build Engine version 16.10.1 for Mono
Copyright (C) Microsoft Corporation. All rights reserved.

Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch.
Build started 22/12/2022 10:20:42 p.m..
Project "/opt/HTFanControl/HTFanControl.sln" on node 1 (default targets).
ValidateSolutionConfiguration:
  Building solution configuration "Debug|Any CPU".
Project "/opt/HTFanControl/HTFanControl.sln" (1) is building "/opt/HTFanControl/HTFanControl/HTFanControl.csproj" (2) on node 1 (default targets).
/usr/share/dotnet/sdk/5.0.408/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(241,5): error NETSDK1004: Assets file '/opt/HTFanControl/HTFanControl/obj/project.assets.json' not found. Run a NuGet package restore to generate this file. [/opt/HTFanControl/HTFanControl/HTFanControl.csproj]
Done Building Project "/opt/HTFanControl/HTFanControl/HTFanControl.csproj" (default targets) -- FAILED.
Project "/opt/HTFanControl/HTFanControl.sln" (1) is building "/opt/HTFanControl/FanTrayIcon/FanTrayIcon.csproj" (3) on node 1 (default targets).
/usr/share/dotnet/sdk/5.0.408/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/opt/HTFanControl/FanTrayIcon/FanTrayIcon.csproj]
Done Building Project "/opt/HTFanControl/FanTrayIcon/FanTrayIcon.csproj" (default targets) -- FAILED.
Done Building Project "/opt/HTFanControl/HTFanControl.sln" (default targets) -- FAILED.

Build FAILED.

"/opt/HTFanControl/HTFanControl.sln" (default target) (1) ->
"/opt/HTFanControl/HTFanControl/HTFanControl.csproj" (default target) (2) ->
(ResolvePackageAssets target) ->
  /usr/share/dotnet/sdk/5.0.408/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(241,5): error NETSDK1004: Assets file '/opt/HTFanControl/HTFanControl/obj/project.assets.json' not found. Run a NuGet package restore to generate this file. [/opt/HTFanControl/HTFanControl/HTFanControl.csproj]


"/opt/HTFanControl/HTFanControl.sln" (default target) (1) ->
"/opt/HTFanControl/FanTrayIcon/FanTrayIcon.csproj" (default target) (3) ->
(ProcessFrameworkReferences target) ->
  /usr/share/dotnet/sdk/5.0.408/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/opt/HTFanControl/FanTrayIcon/FanTrayIcon.csproj]

    0 Warning(s)
    2 Error(s)

Time Elapsed 00:00:01.16

I found this on StackOverflow: https://stackoverflow.com/a/73038414/304706

Starting with net6 SDK 6.0.4xx, it will be possible to build WPF/WinForms projects on non-windows operating systems.

It requires <EnableWindowsTargeting>true</EnableWindowsTargeting> to be set in the csproj or a Directory.Build.props file.

dotnet/docs#30076

Would it be possible to make some changes so that I can compile it on Mac / Debian / Raspberry Pi?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions