At my company, I can't get NuGetToolInstaller task to work in Azure Builds. I think it is having trouble getting out passed the proxy so I just don't use the task and rely on a cached version of NuGet.exe. However, the problem is the cached version is an older version NuGet 4.1.0 and I have no idea how to update it.
I was able to trick it by going to the location of the NuGet.exe file in the 4.1.0 folder and overwriting it with NuGet 5.5.1 version. Seems kludgy to me.
My question:
What's the correct way to update the NuGet.exe in cache used by the build agent folder?
Bonus:
I have proxy credentials, how do I make the NuGetToolInstaller work?
As a workaround , after downloading NuGet 5.5.1 to your local, you can set the local path of nuget.exe into your path environment variable (Copy the location of nuget.exe > Navigate to Control Panel > System > Advanced System Settings > Environment Variables). Then when using self-hosted agent , you can directly call nuget command through cmd task in azure devops.
Related
I am working on a build to run a powershell script on a remote machine, using the VSTS task :
I currently am using TFS2017 on premise, and this is version 1 of that task.
There is a version 3 available on github here :
https://github.com/Microsoft/azure-pipelines-tasks/tree/master/Tasks/PowerShellOnTargetMachinesV3
I am having an issue with this task failing, and I have read elsewhere that this version has a fix for my issue, so I want to update it if possible.
I tried a few ways to do this, but I cannot work out what I am supposed to be doing. You would think there would be an update button in TFS!
Well, there is, but it requests that you provide a .VISX file. Which the repo in GIT does not have.
I've tried running the steps in this other post:
How to update the built-in Microsoft task library in TFS 2017?
But running the command "npm run package -- --version " doesn't generate the VISX.
I tried running :
npm run package --PowerShellOnTargetMachinesV3 --version 3.1.3
That responds with the output:
5.6.0
Which I am not sure what to do with!
I have seen another post that says I need to use the tfs-cli?
I'm very confused.
Any help is appreciated!
Since you are working on TFS on-premise, the task version will not auto update. You need to manually install "PowerShell on Target Machines" task version 3.0
You just need to download the source code and package it as an extension, finally upload and install your extension. There are some steps updated:
Get the package tool (tfx-cli)
You can install or update the TFS Cross Platform Command Line Interface (tfx-cli) using npm, a component of Node.js, from your command line.
npm i -g tfx-cli
Package your extension in a .vsix file
tfx extension create --manifest-globs vss-extension.json
More details please refer this official tutorial: Package, publish extensions.
I have a Visual Studio solution and am trying to build to run on a Linux installation of Docker. As part of the process I need to copy the XML documentation from one of the nuget packages for my Swagger documentation. On my windows development box, I am able to do this, but on Linux it is not working. The problem seems to be when I look at the lib folder for the nuget package on linux I see only a .dll while on Windows I see both .dll and .xml. Below is my restore command
RUN dotnet restore "src/Management/Management.csproj"
Why is the XML file not being extracted on linux?
On another note it seems like linux creates the directories using all lower case. So if I am extracting nuget package Test.MyPackage-3.4.3 it will be located on linux at /root/.nuget/.../test.mypackage/3.4.3. In my csproj file I am referencing the package using %(PackageReference.Identity) which returns the camel-case capitalization. Is there a work-around for this as well?
Not sure if it's still a relevant question.
There is an Env variable NUGET_XMLDOC_MODE which is set to skip in Docker image provided by Microsoft.
If you change it to ENV NUGET_XMLDOC_MODE=none in your Dockerfile it will fix the issue. However image build time will definitely increase so you can consider having dotnet restore as a separate step to enable caching.
More info can be found here
https://learn.microsoft.com/en-us/nuget/reference/cli-reference/cli-ref-environment-variables
I'm getting this error when I try to build a .NET Core solution with Azure DevOps:
error NU1102: Unable to find package NuGet Frameworks with version (>= 4.9.3)
error NU1102: - Found 33 version(s) in http://nuget.bentley.com/nuget/Default [ Nearest version: 4.7.0-preview1-4986 ]
The error occurs in the Cake script when a NuGet restore is being executed by dotnet.exe CLI:
Executing: "d:/vsts/a/_tool/dncs/2.2.100/x64/dotnet.exe" restore "./src/StorageRegistryPortal.sln" --source "http://nuget.bentley.com/nuget/Default"
It tries to restore the NuGet packages from the solution file before throwing the NU1102 error above:
Restoring packages for d:\vsts\a\2921\s\src\StorageRegistryPortal\StorageRegistryPortal.csproj...
Nothing in my solution is referencing this "NuGet.Frameworks" package. So, I wonder if it is the "dotnet.exe" CLI itself that depends on this nuget package before it can restore the rest of the NuGet packages. Also, this only happens in AzureDevops. When I execute the build/cake script on my local PC, it is able to successfully restore all of the nuget packages with no issues.
I've already tried adding a "Use Nuget 4.9.3" task to the build pipeline, but I get the same error.
NOTE: If I remove that "Use Nuget 4.9.3" task, then the error changes to (>= 4.7.0). So, it appears to be looking for the Nuget.Framework that matches the current version of nuget.exe but not finding it.
Here is the screenshot of my build pipeline setup:
TL;DR
This sometimes happens when running dotnet restore on one of my Linux/Ubuntu build servers when pulling from a private Azure DevOps Artifacts/Packages NuGet repo.
The solutions that work for me:
Rebooting the Linux machine, or
Deleting the NuGet cache at ~/.local/share/NuGet/v3-cache/[directory-with-name-of-my-private-nuget-repo]
Background
The error I get is:
error NU1102: Unable to find package [Name-of-my-custom-nuget-package] with version (>= 5.0.116)
I have a nuget.config file that is properly configured to pull down my NuGet packages.
The error is complete nonsense.
The version does exist
Other Linux boxes have no problems running dotnet restore and getting the version of the package
I can run dotnet restore on the same Linux machine for other (older) versions and it's fine
It just seems that dotnet restore decides, for whatever reason, that it's not even going to try to look for the new version of the package.
I've generally found Azure DevOps private NuGet repos secured with AAD to be especially problematic and annoying when dealing with Linux. It really needs some love and attention from the NuGet team.
I was finally able to resolve this issue. It turns out there was a breaking change from the nuget.org folks which caused our internal nuget server to fail to serve the 4.7 and 4.9.3 versions of NuGet.Frameworks. This is an essential nuget library which is required by dotnet.exe to restore nuget packages. For .net core projects, that framework needs to be version 4.7 or higher. Anyway, the resolution was that we had to make adjustments to our internal nuget server to account for the changes from nuget.org.
Could you please have a try to use Nuget 4.9.1 as screenshot then run your build again?
Hope it helps.
Try to download Nuget.Framework of higher version from here https://www.nuget.org/downloads.
In my case it was a problem with version 5.0.0 and I installed 5.0.2 then error disappeared.
My current platform version is: Node.js running on 64bit Amazon Linux/2.0.1
Which support following NodeJS versions: 0.12.6, 0.10.39, 0.10.38, 0.10.31, 0.8.28
I am looking a way to upgrade the NodeJS version: 4.x.x which seems to be available in platform version: Node.js running on 64bit Amazon Linux/3.1.0
but when I am upgrading it. it's says
How can I select the allowed version as it's not available.
Any Help,
Thanks,
P.S
1. Already tried via save / load configurations. Unable to find any option there.
2. Don't want to do setup it from the scratch for now.
First, ensure that you have tested the changes adequately before deploying to production. After that, you can:
Note the name of the Platform ARN/Solution Stack you want to upgrade to.
Perform eb init --region REGION_NAME and pick the application and environment you are working on
Perform eb config. This opens your environment's configuration in an editor. Change the value of the PlatformArn to the one you noted above in step 1.
Also in the editor, find the option setting aws:elasticbeanstalk:container:nodejs. Change the NodeVersion to 6.9.1 or one that the error message above suggests.
Save and quit.
After the configuration is complete:
Perform eb status to verify that your environment is using the upgraded Solution Stack.
You can clone the existing environment to a new one, using a different platform version.
In the Actions menu, select "Clone with the latest platform".
That opens a new page where you can select from available OS/nodejs versions.
Once you are satisfied with the new environment, you can swap URLs with the old one in order to replace it. After that, you can remove the older env.
This has happened a few times before when Amazon releases new Environments and they do not include versions in common between the environments. The solution is to set value for nodejs version to an empty string which means to use the latest version. It could break your app, but you can make a clone with latest platform and switch to desired version of nodejs later. So run this command to do that:
aws elasticbeanstalk update-environment --region "your region" --application-name "your app" --environment-name "your env" --option-settings "OptionName=NodeVersion,Namespace=aws:elasticbeanstalk:container:nodejs,Value=''"
I have just set up a TFS 2017 server and am trying to go through the CI tutorial at https://learn.microsoft.com/en-us/vsts/build-release/apps/nodejs/build-gulp?tabs=vsts but am having trouble on the Gulp task. I am getting the error "Not found node: null". I am using an ubuntu agent with the most recent versions of node, npm, and gulp installed. All the tasks are configured exactly as described in the tutorial.
The error usually means you have an environment issue , such as node couldn't captured by TFS build agent.
For the Default agent queue:
VSTS: Select Hosted VS2017. This is how you can use our pool of agents that have the software you need to build your app.
TFS: Select a queue that includes a Windows build agent.
Source Link
If you are working with linux build agent, you need to use windows build agent instead of ubuntu(linux build) agent.
If you are working with windows agent, make sure the node, npm, and gulp installed before TFS build agent configured, otherwise the new capability will not captured.
You need to reconfigure the build agent or restart VSO agent service. Besides make sure your working directory of Gulp task is getting set properly.
I ended up uninstalling and reinstalling nodejs and npm. I believe the problem was that TFS did not sense the node.js and npm capabilities because I originally installed them using nvm, so the second time around I installed using apt packages and everything worked fine.