question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[.NET] Fail to build on Ubuntu Linux

See original GitHub issue

Describe the bug I’ve set alias nuget='mono /usr/local/bin/nuget.exe' and command -v nuget does not fail on my bash shell. But when I run build.sh, it fails with NuGet not found. Make sure it's installed and included in PATH. Aborting. message.

To Reproduce Steps to reproduce the behavior:

  1. Go to ‘.NET’
  2. Type ‘./build.sh’
  3. See error like this.
$ ./build.sh 
// Building .NET platform
NuGet not found. Make sure it's installed and included in PATH. Aborting.

Expected behavior setting alias nuget='mono /usr/local/bin/nuget.exe' is the only way recommend by MS help page.

When I type nuget, I got this:

$ nuget
NuGet Version: 5.1.0.6013
usage: NuGet <command> [args] [options] 
Type 'NuGet help <command>' for help on a specific command.

Available commands:

 add               Adds the given package to a hierarchical source. http sources are not supported. For more info, goto https://docs.nuget.org/consume/command-line-reference#add-command.

 config            Gets or sets NuGet config values.

 delete            Deletes a package from the server.

 help (?)          Displays general help information and help information about other commands.

 init              Adds all the packages from the <srcPackageSourcePath> to the hierarchical <destPackageSourcePath>. http feeds are not supported. For more info, goto https://docs.nuget.org/consume/command-line-reference#in
it-command.

 install           Installs a package using the specified sources. If no sources are specified, all sources defined in the NuGet configuration file are used. If the configuration file specifies no sources, uses the default N
uGet feed.

 list              Displays a list of packages from a given source. If no sources are specified, all sources defined in %AppData%\NuGet\NuGet.config are used. If NuGet.config specifies no sources, uses the default NuGet feed
.

 locals            Clears or lists local NuGet resources such as http requests cache, temp cache or machine-wide global packages folder.

 pack              Creates a NuGet package based on the specified nuspec or project file.

 push              Pushes a package to the server and publishes it.
NuGet's default configuration is obtained by loading %AppData%\NuGet\NuGet.config, then loading any nuget.config or .nuget\nuget.config starting from root of drive and ending in current directory.

 restore           Restores NuGet packages.

 setApiKey         Saves an API key for a given server URL. When no URL is provided API key is saved for the NuGet gallery.

 sign              Signs a NuGet package with the specified certificate.

 sources           Provides the ability to manage list of sources located in %AppData%\NuGet\NuGet.config

 spec              Generates a nuspec for a new package. If this command is run in the same folder as a project file (.csproj, .vbproj, .fsproj), it will create a tokenized nuspec file.

 trusted-signers   Provides the ability to manage the list of trusted signers.

 update            Update packages to latest available versions. This command also updates NuGet.exe itself.

 verify            Verifies a signed NuGet package.

For more information, visit https://docs.nuget.org/docs/reference/command-line-reference

It’s very strange why build.sh does not work as intended.

Platform (please complete the following information):

  • Platform: [.NET]
  • Environment: [NuGet Version: 5.1.0.6013]
  • Version of package [master]

Additional context I’m using Ubuntu 18.04.2 LTS.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
iMicknlcommented, Aug 6, 2019

I just gave it a try on my Mac and it builds without issues. My preference would be to have nuget as a required dependency and not set the alias in the build script.

@combacsa have you tried adding the alias to your ~/.bash_aliases or ~/.bash_profile as described in the link you mentioned.

0reactions
combacsacommented, Aug 6, 2019

Just wrote a pull request #1780 which works on my Ubuntu machine. It would be appreciated if it also works on the Mac.

Read more comments on GitHub >

github_iconTop Results From Across the Web

'dotnet build' fails on Ubuntu, redstone 1 · Issue #6739
@soeleman The workaround did not work for me: I'm .NET Command Line Tools (1.0.0-preview2-003131) and trying to run on Bash on Ubuntu on ......
Read more >
Install the .NET SDK or the .NET Runtime on Ubuntu
Demonstrates the various ways to install .NET SDK and .NET Runtime on Ubuntu.
Read more >
dotnet error on ubuntu when trying to compile a cloned repo
I have dotnet 6.0.2 and visual studio code on my linux machine. ... dotnet error on ubuntu when trying to compile a cloned...
Read more >
Build fails randomly on Ubuntu
Hi. I have build agent installed on Ubuntu and lately they start failing randomly with error: ##[error]Error: The process '/usr/bin/dotnet' ...
Read more >
VS Code not able to find .Net 6 in Ubuntu
I am running Ubuntu 20.04, vscode, and .net 6. When I try to load my app in vs studio, I get this error:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found