I have asp.net core 2.0 app, which references Microsoft.AspNetCore.All metadata package
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
and I have following build in VSTS which I build using hosted build agent.
Why it always takes min 95 seconds to restore the packages? I thought that
Microsoft.AspNetCore.All
packages are cached in ".NET Core runtime store" so they don't have to be restored.Why is dotnet restore so slow in VSTS?
Edit: Vote for better VSTS build performance here: https://visualstudio.uservoice.com/forums/330519-visual-studio-team-services/suggestions/32044321-improve-hosted-build-agent-performance
In most cases, you don't need to explicitly use the dotnet restore command, since a NuGet restore is run implicitly if necessary when you run the following commands: dotnet new. dotnet build. dotnet build-server.
nuget restore will ensure all of your NuGet dependencies are downloaded and available to your project. Whereas dotnet restore is a complete restoration of all NuGet dependencies as well as references and project specific tools. Meaning that if you run nuget restore , you are only restoring NuGet packages.
Description. The dotnet restore command uses NuGet to restore dependencies as well as project-specific tools that are specified in the project file.
From the Microsoft Docs on Hosted Agents:
Capabilities and limitations
Hosted agents:
- Run as a service.
- Have the above software. You can also add software using our tool installers.
- Provide 10GB of storage.
Hosted agents do not offer:
- Interactive mode.
- Administrator privileges.
- The ability to log on.
- The ability to drop artifacts to a UNC file share.
- The ability to run XAML builds.
- Potential performance advantages that you might get by using private agents which might start and process builds faster. Learn more
If our hosted agents don't meet your needs, then you can deploy your own private agents.
Long and short, using the hosted agents, what you get is what you get. If it's not fast enough for you or doesn't do something else you'd like (such as caching of NuGet packages), then your recourse is to create your own private build agent.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With