How to remove VSTS packages with cmdlets - azure-artifacts

I want to clear up the old VSTS Packages, and don't want to remove it individually. How can I do this with cmdlets?

For CLI, you can just unlist VSTS packages but not delete them.
Currently, NuGet.exe can only unlist packages; Team Services and TFS
interpret nuget.exe delete as an unlist operation to be consistent
with NuGet.org. To delete a package, you must use either the REST APIs
or the web interface.
More details, you can refer unlist a package.
And deleting VSTS packages by REST API, you can referdelete package.

Related

TeamCity Nuget update private package only

We have a .net solution with around 30 projects in it.
We have a dependency on another internal project ( not in the same solution ), for which we use TeamCity NuGet to get the latest packages.
Currently, We update all packages using nuget update-packages command with a specific version that we need and check-in our code and then TeamCity builds it.
(We commit packages too)
We are looking for a simpler solution where TeamCity can automatically update to the latest package and check-in into TFS.
I have tried using TeamCity NuGet installer but it didn't work, also, what I want is to get updates only for a specific package (not all the packages in projects).
I want to execute my NuGet update-packages command as a TeamCity build step so that it will update the packages and we don't have to do it manually every time we have a new update available.
i think best option is you can use ms build.
msbuild will allow you to publish or push the nuget package along with version to server or will do checkin to tfs which is change.
Thanks
DJM

How to update the built-in Microsoft task library in TFS 2017?

What is the process for upgrading the default tasks loaded by Microsoft in an on-premises TFS with no internet connectivity?
According to https://learn.microsoft.com/en-us/vsts/build-release/tasks/ there are several tasks now available and supported in TFS v2015-2018/VSTS that do not appear in my TFS 2017u2 installation (specifically the Download Secure File task).
The default tasks are not shown in the Manage Extension screens and the git repo (https://github.com/Microsoft/vsts-tasks) does not appear to have any instructions for how to package and install the latest versions in an existing TFS.
Download Secure File this task is not support by TFS2017 update2 for now.
In the right of the task, there is a column called Versions which stands for the supported TFS version and VSTS for now.
I use TFS on-premises and I don't see some of these features. Why not?
Some of these features are available only on VSTS and not yet
available on-premises. Some features are available on-premises if
you have upgraded to the latest version of TFS.
Source Link
The task you need is only available/build-in with VSTS by now.
However, this task is open sourced, you could find it here. You could also build it and package it as normal extension. Take a look at below steps for your reference:
Globally install typescript and tfx-cli (to package VSTS
extensions): npm install -g typescript tfx-cli
From the suitable of the repo run npm install. This will pull down
the necessary modules for the tasks and for the build tools.
Run npm run build to compile the build tasks or build a specific
task (recommended): node make.js build --task ShellScript
Run npm run package -- --version <version> to create the .vsix
extension packages (supports multiple environments) that includes
the build tasks.
With the .vsix files, you are easy to directly upload the extension. Details about this area, you could refer here:
How do you install extension vsix files to TFS 2015 (Update 3)?
How do I use the tfs-cli (tfx) to update a TFS extension for an on-premise TFS instance?
Besides, even you have published the extension to your TFS successfully, this task may not compatible with your present version, just Giulio said, you could create a test first. Certainly, you could also create your own extension as your demands.
Look at the Contribute page: it is a bit cryptic if you are not familiar with Javascript tooling.
CAVEAT: there is no guarantee that an update Task works with your TFS version and rolling back a change is a non-trivial task. Use, at least, a separate Collection to test changes.

TFS Build missing Castle Windsor

I used NuGet to add CastleWindsor to a project. Eveything works ok.
When I check it into tfs, I get the following message.
Unable to find version '3.3.3' of package 'Castle.Core'.
Any idea how I can get the build server to get the new version of Castle.Core?
First just as Dave commented, please check if you have add the nuget install task in your build definition and before your build task.
Also make sure you are using the right version of Nuget. For example, if you already use V3.0 and the config file are still point to V2.0. You will get this error.
Moreover, double check if the packages can be restored successfully on you dev PC and build agent manually, you can also compare the nuget.config file on your TFS server and dev PCs to see if there is any difference between them. The nuget.config file locates at "%APPDATA%\NuGet\NuGet.Config".
TFS2012 does not restore the nuget packages automatically, you need to add a build step to call the nuget command to restore the nuget packages. Refer to this link for details: Package Restore with Team Foundation Build.
With TFS 2013 and later, packages are automatically restored by
default during build, provided that you're using a Team Build Template
for Team Foundation Server 2013 or later.
If you're using a previous version of build templates (such as in a
project that's been migrated from earlier versions of TFS), you'll
need to also migrate those build templates to TFS 2013. This
essentially means recreating the custom parts of the Build Templates
using the appropriate template for your source control (TFVC or Git).
For earlier version of TFS, you can simply include a build step to
invoke command-line restore as described earlier.

Tfs vNext, Restore Nuget packages build step, how to configure multiple sources?

I have a Restore Nuget packages build step as part of my vNext (onsite premises TFS 2015) build.
This step allows you to configure Nuget arguments.
Here I have configured the source to pull from a local network share, where we store internal Nuget packages.
-source "\\myNetworkShare\Nuget Packages"
However, we also use public Nuget packages, such as Postsharp, etc.
I want this step to resolve from multiple sources (or at least two).
1 being the internal network share, the other being the public nuget.org server.
How is this possible?
Adding multiple source is supported in one NuGet config file. Specify your custom NuGet feed URL’s and the public Nuget packages server's url in the solution’s nuget.config file.
You need to set up your own nuget server instead of a local network share to hold the packages. Detail ways about this please refer How to host your own NuGet Server and Package Feed
Next, just continue to execute the default NuGet Restore step from build task. Now all packages will be restored and can be continue with the build.

tfs errors during nuget execution

During nuget package installation I get a lot of tfs errors like:
"The item could not be found in your workspace, or you do not have permission to access it."
For every file in the package. What it is? Why tfs tires to access that files at all?
Have you checked in the packages to TFS? if the packages are under source control they will be read only and won't be able to be updated. Enable NuGet restore either on the solution (old way) or use the new way (see NuGet.org) and remove the packages from source control

Resources