DevToys-app / DevToys

A Swiss Army knife for developers.
https://devtoys.app/
MIT License
26.57k stars 1.42k forks source link

DevToys source code failed to compile due to missing ResxHelperGenerator.dll #1224

Open reinhart1010 opened 2 months ago

reinhart1010 commented 2 months ago

Current behavior

The current .NET project failed to build with the following logs:

dotnet build /home/shift/projects/devtoys/src/app/dev/platforms/desktop/DevToys.Linux/DevToys.Linux.csproj /property:GenerateFullPaths=true /consoleloggerparameters:NoSummary 
MSBuild version 17.8.5+b5265ef37 for .NET
  Determining projects to restore...
  All projects are up-to-date for restore.
  DevToys.Api -> /home/shift/projects/devtoys/bin/Debug/AnyCPU/DevToys.Api/net8.0/DevToys.Api.dll
CSC : error CS0006: Metadata file '/home/shift/projects/devtoys/src/generators/ResxHelperGenerator/bin/netstandard2.0/ResxHelperGenerator.dll' could not be found [/home/shift/projects/devtoys/src/app/dev/DevToys.Localization/DevToys.Localization.csproj::TargetFramework=net8.0]

How to reproduce it (as minimally and precisely as possible)

  1. Make sure to install .NET 8 via Fedora's package manager (dnf install dotnet-sdk-8.0 dotnet-runtime-8.0)
  2. Make sure that the necessary Linux-specific libraries (libadwaita etc.) are also installed
  3. Clone and open the repository in Visual Studio Code
  4. Run bash ./init.sh (without sudo as recommended in CONTRIBUTING.md)
  5. Perform a debug build on either "DevToys CLI" or "DevToys Linux"

Expected behavior

The required DLL should exist to be able to compile for both CLI and GUI app.

Screenshots

No response

Workaround

No response

Affected platforms

Linux

Affected DevToys kind

DevToys (app with GUI), DevToys CLI

DevToys Version

Version: 2.0.0.0 (Commit 211c66f) | .NET Version: 8.0.100 | OS Version: Fedora Linux 40

Relevant Assets/Logs

No response

reinhart1010 commented 2 months ago

I believe this might also be mentioned on microsoft/vscode-dotnettools#245:

I tried re-targeting it, but then I got some build errors about ResxHelperGenerator.dll.

veler commented 2 months ago

Hi, I hit this issue a few random times myself. I noticed the issue vanishes if I build ResxHelperGenerator project alone first, before building the whole solution. Can you please try that? This is just a workaround that works for me and I don't have a good solution so far.

reinhart1010 commented 2 months ago

image

Confirmed that the build now works.

I noticed the issue vanishes if I build ResxHelperGenerator project alone first, before building the whole solution.

Should this be documented first as a temporary workaround in CONTRIBUTING.md? Also, why the use of sudo in bash ./init.sh (this will make the project files failed to build due to "insufficient permissions" issue)?

veler commented 2 months ago

Thanks for confirming ! yes, i should probably add this as a workaround. For the sudo command, I recall having trouble when not using it, because dotnet needed it in order to install some tools. But perhaps I'm not remembering correctly and it's not needed anymore. I will have to test on a fresh VM.

badcel commented 2 months ago

As far as I know you can install dotnet tools on a system and user level. The user level should not need increased privileges and should be preferred from my point of view.

reinhart1010 commented 2 months ago

As far as I know you can install dotnet tools on a system and user level. The user level should not need increased privileges and should be preferred from my point of view.

Maybe that varies between platforms? I am using the official pre-packaged version of dotnet-tools: dotnet-sdk-8.0 and dotnet-runtime-8.0.

badcel commented 2 months ago

Ah perhaps I misinterpreted global/ local tools: https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-tool-install

Nevertheless there should be no need for sudo.