Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build SharpView EXE from Linux #8

Open
noraj opened this issue Dec 17, 2021 · 1 comment
Open

Build SharpView EXE from Linux #8

noraj opened this issue Dec 17, 2021 · 1 comment

Comments

@noraj
Copy link

noraj commented Dec 17, 2021

Context

One may not want to install a Windows VM + install Visual Studio just to build a tool. So I tried to build SharpView exe with Mono, MSBuild, .NET SDk, and NuGet on Linux.

Prerequisites

On ArchLinux:

$ pacman -S mono-msbuild dotnet-sdk nuget
$ pikaur -S mono-git

Version

  • mono 6.13.0
  • msbuild 16.10.1.xamarinxplat.2021.05.26.14.00
  • dotnet sdk 6.0.0.sdk100
  • nuget 5.10.0

Build steps

$ git clone https://github.com/tevora-threat/SharpView.git
$ cd SharpView
$ nuget restore
$ msbuild SharpView.sln
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 12/22/2021 5:42:03 PM.
Project "/tmp/SharpView/SharpView.sln" on node 1 (default targets).
ValidateSolutionConfiguration:
  Building solution configuration "Debug|Any CPU".
Project "/tmp/SharpView/SharpView.sln" (1) is building "/tmp/SharpView/SharpView/SharpView.csproj" (2) on node 1 (default targets).
PrepareForBuild:
  Creating directory "bin/Debug/".
  Creating directory "obj/Debug/".
ResolveAssemblyReferences:
  Primary reference "System.DirectoryServices.AccountManagement".
/usr/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(2218,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "System.DirectoryServices.AccountManagement". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [/tmp/SharpView/SharpView/SharpView.csproj]
          For SearchPath "{TargetFrameworkDirectory}".
          Considered "/usr/lib/mono/xbuild-frameworks/.NETFramework/v4.5.2/System.DirectoryServices.AccountManagement.winmd", but it didn't exist.
          Considered "/usr/lib/mono/xbuild-frameworks/.NETFramework/v4.5.2/System.DirectoryServices.AccountManagement.dll", but it didn't exist.
          Considered "/usr/lib/mono/xbuild-frameworks/.NETFramework/v4.5.2/System.DirectoryServices.AccountManagement.exe", but it didn't exist.
          Considered "/usr/lib/mono/4.5.2-api/System.DirectoryServices.AccountManagement.winmd", but it didn't exist.
          Considered "/usr/lib/mono/4.5.2-api/System.DirectoryServices.AccountManagement.dll", but it didn't exist.
          Considered "/usr/lib/mono/4.5.2-api/System.DirectoryServices.AccountManagement.exe", but it didn't exist.
          Considered "/usr/lib/mono/4.5.2-api/Facades/System.DirectoryServices.AccountManagement.winmd", but it didn't exist.
          Considered "/usr/lib/mono/4.5.2-api/Facades/System.DirectoryServices.AccountManagement.dll", but it didn't exist.
          Considered "/usr/lib/mono/4.5.2-api/Facades/System.DirectoryServices.AccountManagement.exe", but it didn't exist.
          Considered "/usr/lib/mono/4.5.2-api/Facades/System.DirectoryServices.AccountManagement.winmd", but it didn't exist.
          Considered "/usr/lib/mono/4.5.2-api/Facades/System.DirectoryServices.AccountManagement.dll", but it didn't exist.
          Considered "/usr/lib/mono/4.5.2-api/Facades/System.DirectoryServices.AccountManagement.exe", but it didn't exist.
          For SearchPath "{GAC}".
          Considered "System.DirectoryServices.AccountManagement", which was not found in the GAC.
          For SearchPath "{RawFileName}".
          Considered treating "System.DirectoryServices.AccountManagement" as a file name, but it didn't exist.
          For SearchPath "bin/Debug/".
          Considered "bin/Debug/System.DirectoryServices.AccountManagement.winmd", but it didn't exist.
          Considered "bin/Debug/System.DirectoryServices.AccountManagement.dll", but it didn't exist.
          Considered "bin/Debug/System.DirectoryServices.AccountManagement.exe", but it didn't exist.
GenerateBindingRedirects:
  No suggested binding redirects from ResolveAssemblyReferences.
/usr/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(2842,5): warning MSB3084: Task attempted to find "AxImp.exe" in two locations. 1) Under the "/usr/lib/mono/4.5/" processor specific directory which is generated based on SdkToolsPath 2) The x86 specific directory under "/usr/lib/mono/4.5/" which is specified by the SDKToolsPath property. You may be able to solve the problem by doing one of the following:  1) Set the "SDKToolsPath" property to the location of the Microsoft Windows SDK. [/tmp/SharpView/SharpView/SharpView.csproj]
/usr/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(2842,5): error MSB3086: Task could not find "AxImp.exe" using the SdkToolsPath "/usr/lib/mono/4.5/" or the registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\NETFXSDK\4.8\WinSDK-NetFx40Tools-x86". Make sure the SdkToolsPath is set and the tool exists in the correct processor specific location under the SdkToolsPath and that the Microsoft Windows SDK is installed [/tmp/SharpView/SharpView/SharpView.csproj]
Done Building Project "/tmp/SharpView/SharpView/SharpView.csproj" (default targets) -- FAILED.
Done Building Project "/tmp/SharpView/SharpView.sln" (default targets) -- FAILED.

Build FAILED.

"/tmp/SharpView/SharpView.sln" (default target) (1) ->
"/tmp/SharpView/SharpView/SharpView.csproj" (default target) (2) ->
(ResolveAssemblyReferences target) ->
  /usr/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(2218,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "System.DirectoryServices.AccountManagement". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [/tmp/SharpView/SharpView/SharpView.csproj]


"/tmp/SharpView/SharpView.sln" (default target) (1) ->
"/tmp/SharpView/SharpView/SharpView.csproj" (default target) (2) ->
(ResolveComReferences target) ->
  /usr/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(2842,5): warning MSB3084: Task attempted to find "AxImp.exe" in two locations. 1) Under the "/usr/lib/mono/4.5/" processor specific directory which is generated based on SdkToolsPath 2) The x86 specific directory under "/usr/lib/mono/4.5/" which is specified by the SDKToolsPath property. You may be able to solve the problem by doing one of the following:  1) Set the "SDKToolsPath" property to the location of the Microsoft Windows SDK. [/tmp/SharpView/SharpView/SharpView.csproj]


"/tmp/SharpView/SharpView.sln" (default target) (1) ->
"/tmp/SharpView/SharpView/SharpView.csproj" (default target) (2) ->
(ResolveComReferences target) ->
  /usr/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(2842,5): error MSB3086: Task could not find "AxImp.exe" using the SdkToolsPath "/usr/lib/mono/4.5/" or the registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\NETFXSDK\4.8\WinSDK-NetFx40Tools-x86". Make sure the SdkToolsPath is set and the tool exists in the correct processor specific location under the SdkToolsPath and that the Microsoft Windows SDK is installed [/tmp/SharpView/SharpView/SharpView.csproj]

    2 Warning(s)
    1 Error(s)

Time Elapsed 00:00:01.26

Question

How to build SharpView exe from Linux?

@noraj noraj changed the title Build SharpView DLL from Linux Build SharpView EXE from Linux Dec 17, 2021
@noraj
Copy link
Author

noraj commented Dec 17, 2021

Seems related to https://bugs.archlinux.org/task/71007 Updated to mono 6.13.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant