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

Nethereum.Autogen.ContractApi breaks when using NUGET_PACKAGES #1026

Open
Vhab opened this issue May 6, 2024 · 0 comments
Open

Nethereum.Autogen.ContractApi breaks when using NUGET_PACKAGES #1026

Vhab opened this issue May 6, 2024 · 0 comments

Comments

@Vhab
Copy link

Vhab commented May 6, 2024

We are using the NUGET_PACKAGES environment variable during CI to move nuget packages to a specific location for caching and restoring cache.
Please see https://learn.microsoft.com/en-us/nuget/reference/cli-reference/cli-ref-environment-variables for more information about NUGET_PACKAGES

However, the nethereum targets have hardcoded the nuget package path in: https://github.com/Nethereum/Nethereum/blob/master/generators/Nethereum.Autogen.ContractApi/nuget/Nethereum.Autogen.ContractApi.targets

Thus this breaks our build.

Expected Behavior

Expected Nethereum.Autogen.ContractApi to work when combined with NUGET_PACKAGES

Current Behavior

  Nethereum: Code generating dotnet files based on abi files in project and/or Nethereum.Generator.json
...
  Could not execute because the specified command or file was not found.
  Possible reasons for this include:
    * You misspelled a built-in dotnet command.
    * You intended to execute a .NET program, but dotnet-/home/AzDevOps/.nuget/packages/nethereum.autogen.contractapi/4.11.0/tools/Nethereum.Generator.Console.dll does not exist.
    * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.

Possible Solution

Maybe it possible to programmatically get this path instead, something like dotnet nuget locals -l global-packages ?

@Vhab Vhab changed the title Nethereum.Autogen.ContractApi does not check NUGET_PACKAGES Nethereum.Autogen.ContractApi breaks when using NUGET_PACKAGES May 6, 2024
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