dnSpyEx / dnSpy

Unofficial revival of the well known .NET debugger and assembly editor, dnSpy
GNU General Public License v3.0
6.83k stars 452 forks source link

Fails to compile on Linux due to WPF dependencies #19

Closed N3X15 closed 2 years ago

N3X15 commented 3 years ago

Version

commit 68c0ee0e14efbccf63e438c65d14682ab3a4ebbe

Reproduction Steps

  1. Use Ubuntu 20.04 LTS
  2. Install .NET 5.0 SDK via Microsoft's apt repo
  3. clone repository and cd to it in console
  4. run dotnet build

Results

nexis@rob-laptop:~/dnSpy-dev$ dotnet build
Microsoft (R) Build Engine version 16.10.2+857e5a733 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/dnSpy/dnSpy.Contracts.DnSpy/dnSpy.Contracts.DnSpy.csproj]                                                                                                                                                                                                                                                                      
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/dnSpy/Roslyn/dnSpy.Roslyn/dnSpy.Roslyn.csproj]  
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/Extensions/dnSpy.Debugger/dnSpy.Debugger/dnSpy.Debugger.csproj]                                                                                                                                                                                                                                                                
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/dnSpy/dnSpy.Decompiler/dnSpy.Decompiler.csproj] 
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/Extensions/Examples/Example1.Extension/Example1.Extension.csproj]                                                                                                                                                                                                                                                              
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/Extensions/dnSpy.Scripting.Roslyn/dnSpy.Scripting.Roslyn.csproj]                                                                                                                                                                                                                                                               
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/Libraries/ICSharpCode.TreeView/ICSharpCode.TreeView.csproj]                                                                                                                                                                                                                                                                    
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/dnSpy/dnSpy/dnSpy.csproj]                       
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/dnSpy/dnSpy.Images/dnSpy.Images.csproj]         
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/Extensions/dnSpy.AsmEditor/dnSpy.AsmEditor.csproj]                                                                                                                                                                                                                                                                             
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet.CorDebug/dnSpy.Debugger.DotNet.CorDebug.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet.Mono/dnSpy.Debugger.DotNet.Mono.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/Extensions/Examples/Example2.Extension/Example2.Extension.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/Extensions/dnSpy.BamlDecompiler/dnSpy.BamlDecompiler.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/Extensions/ILSpy.Decompiler/dnSpy.Decompiler.ILSpy/dnSpy.Decompiler.ILSpy.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/dnSpy/dnSpy.Console/dnSpy.Console.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/Extensions/dnSpy.Analyzer/dnSpy.Analyzer.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet/dnSpy.Debugger.DotNet.csproj]

Build FAILED.

/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/dnSpy/dnSpy.Contracts.DnSpy/dnSpy.Contracts.DnSpy.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/dnSpy/Roslyn/dnSpy.Roslyn/dnSpy.Roslyn.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/Extensions/dnSpy.Debugger/dnSpy.Debugger/dnSpy.Debugger.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/dnSpy/dnSpy.Decompiler/dnSpy.Decompiler.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/Extensions/Examples/Example1.Extension/Example1.Extension.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/Extensions/dnSpy.Scripting.Roslyn/dnSpy.Scripting.Roslyn.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/Libraries/ICSharpCode.TreeView/ICSharpCode.TreeView.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/dnSpy/dnSpy/dnSpy.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/dnSpy/dnSpy.Images/dnSpy.Images.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/Extensions/dnSpy.AsmEditor/dnSpy.AsmEditor.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet.CorDebug/dnSpy.Debugger.DotNet.CorDebug.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet.Mono/dnSpy.Debugger.DotNet.Mono.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/Extensions/Examples/Example2.Extension/Example2.Extension.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/Extensions/dnSpy.BamlDecompiler/dnSpy.BamlDecompiler.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/Extensions/ILSpy.Decompiler/dnSpy.Decompiler.ILSpy/dnSpy.Decompiler.ILSpy.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/dnSpy/dnSpy.Console/dnSpy.Console.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/Extensions/dnSpy.Analyzer/dnSpy.Analyzer.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet/dnSpy.Debugger.DotNet.csproj]
    0 Warning(s)
    18 Error(s)

Time Elapsed 00:00:03.41

Why this is a problem

I know this is a huge PITA to unravel and fix, but it would be nice to at least have the CLI app build on Linux.

ElektroKill commented 2 years ago

Hi, I currently don't have any plans to make dnSpy compilable on Linux. dnSpy is pretty much a windows only app due to WPF being a Windows-only UI framework. While I have seen people run it on Linux under Wine's compatibility layer with various degrees of success, this is not a supported runtime. Making the CLI buildable on Linux would also be rather tough as the CLI references other projects/libraries of dnSpy which themselves have references to the WPF framework and are also scattered with references to other windows only APIs unavailable on Linux. Other than the major changes that would have to be done to the codebase, I also lack knowledge about Linux and have myself not used it much.

Pretty much, the state of this is that unless someone contributes it, I probably won't do it myself. Adding support for Linux is not really a big priority due to how things like the debugger which is one of the highlight features is windows-only due to the strict reliance on things like COM Interop and other Windows-first APIs. For now, I'm closing the issue as "Won't fix", Sorry!

mathgeniuszach commented 1 week ago

For others reading this who may want to see this implemented, ignoring dependencies and the debugger, it could be possible to allow the bulk of the app to build under linux by porting from WPF to MAUI. As dnSpy runs pretty well under wine, this is kinda unnecessary (and you will likely lose support for features that depend on the Windows API).