RobinPerris / DarkUI

Dark themed control and docking library for .NET WinForms.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dotnet build / dotnet msbuild failing

aow99 opened this issue · comments

commented

How could I go about compiling this from the command line? I'm interested in providing instructions to my users to clone this repository and build the binary themselves even if they might not have Visual Studio installed. When I try to use dotnet.exe, its throwing errors and I'm not sure why.

Steps to repro from a cmd prompt:

git clone https://github.com/RobinPerris/DarkUI.git
cd darkui
dotnet build

You should see about 24 errors like the following:

C:\Program Files\dotnet\sdk\5.0.102\Microsoft.Common.CurrentVersion.targets(3075,5): error MSB3822: Non-string resources require the System.Resources.Extensions assembly at runtime, but it was not found in this project's references. [C:\Code\DarkUI\DarkUI\DarkUI.csproj]

Of course in Visual Studio 2019, it loads and builds without any issues at all. Maybe I'm missing some switches? Look forward to seeing if this is doable.

Thanks!

commented

The dotnet CLI tool is only compatible with the .NET Core line of frameworks. DarkUI pre-dates .NET Core and was built using .NET Framework 4.0.

To compile the project using the commandline you'll need to use the older msbuild method. Something like this should work:

C:\Windows\Microsoft.Net\Framework64\v4.0.30319\MSBuild.exe DarkUI.sln /t:Clean;Build

(Change the path to wherever your 4.0 msbuild.exe is located)

I do believe version 5 added support for WinForms to .NET Core, so another option is updating the code and target framework to compile against the latest version. I'm unsure if all of the code will be compatible, however.

commented

That was fast! Sounds like its a non starter then since I dont expect the users of this to have Visual Studio installed. I see there is a download for just the build tools available. I suppose I could provide instructions on using msbuild.exe (providing I test it and works). Might just be better to say something like "If you want to download and build this, you can find the DarkUI repository here" and provide the link. Does that sound reasonable?

commented

To install MSBuild on a system that doesn't have Visual Studio, go to Visual Studio downloads and scroll down to All Downloads, then expand Tools for Visual Studio 2019. Install Build Tools for Visual Studio 2019, which includes MSBuild.

I'd recommend trying this process out yourself before advising others to do the same, however.

commented

Absolutely, I had already planned on doing that. I'm just thinking of whether or not its worth it considering the users of these apps typically do not have the background needed to take on such a task. Thank you for your response, I'm all set it. Feel free to close this out or I can do it now. Thanks again.