tag:help.appveyor.com,2012-11-13:/discussions/problems/2730-cant-build-aspnet-solutionAppVeyor: Discussion 2018-10-19T08:17:23Ztag:help.appveyor.com,2012-11-13:Comment/375872572015-08-06T19:39:00Z2015-08-06T19:39:00ZCan't build asp.net solution !<div><p>Sorry to hear that. We've been seeing nuget restore issues
across all data centres.</p>
<p>What nuget packages do you have problems restoring with?</p>
<p>To reduce dependency on nuget.org availability you can setup
build cache for nuget <a>
packages: http://www.appveyor.com/docs/nuget#dealing-with-intermitt...</a></p>
<ul>
<li>Feodor</li>
</ul></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/375872572015-08-07T01:59:28Z2015-08-07T01:59:28ZCan't build asp.net solution !<div><p>There are many packages that can't be restored. Examples
below:</p>
<p>Unable to find version '5.2.3' of package
'Microsoft.AspNet.Cors'.</p>
<p>Unable to find version '5.2.3' of package
'Microsoft.AspNet.Cors'.<br>
Unable to find version '3.5.2' of package 'Autofac'.<br>
Unable to find version '5.2.3' of package
'Microsoft.AspNet.WebApi.Client'.<br>
Unable to find version '2.0.7' of package
'Serilog.Sinks.MSSqlServer'.<br>
Unable to find version '6.1.0' of package 'Sendgrid'.<br>
Unable to find version '0.15.0-build32981' of package
'Microsoft.ApplicationInsights.JavaScript'.<br>
Unable to find version '3.0.1' of package
'Microsoft.Owin.Security.OAuth'.</p>
<p>I've enabled package cache as you suggested but still no luck.
What I don't understand is that I can't reproduce these issues even
when my nuget package is empty on my local environment.</p>
<p>Thanks<br>
Andre</p>
<p>---- On Thu, 06 Aug 2015 16:39:01 -0300 Feodor Fitsner
<<a href="mailto:tender2+d5fe34820d@tenderapp.com">tender2+d5fe34820d@tenderapp.com</a>>
wrote ----</p></div>Andre Gallotag:help.appveyor.com,2012-11-13:Comment/375872572015-08-07T02:10:15Z2015-08-07T02:10:15ZCan't build asp.net solution !<div><p>AppVeyor build cache works when all packages are restored and
build is successful.</p>
<p>I understand your frustration, but I'm afraid it's a problem on
nuget.org side: <a href="https://twitter.com/nuget/status/629274570701340673">https://twitter.com/nuget/status/629274570701340673</a></p>
<p>Look at these test build results, for example, with nuget
restore verbosity set to detailed. There is no "Unable to connect"
message, but the response "Unable to find ..." comes from nuget.org
API: <a href="https://ci.appveyor.com/project/FeodorFitsner/appveyor-bot-test-2r9sv/build/1.0.2#L133">
https://ci.appveyor.com/project/FeodorFitsner/appveyor-bot-test-2r9...</a>
It's like if you were requested a package with non-existing
version.</p>
<p>Locally it usually works because there is nuget cache in
<code>%localappdata%\NuGet\Cache</code> folder which is
never/rarely cleaned.</p>
<p>Just to further assure you that this is nuget.org issue I've
just removed <code>%localappdata%\NuGet\Cache</code> folder and did
nuget restore for <a href="https://github.com/FeodorFitsner/appveyor-bot-test">this
project</a>. Result attached - this is my local dev machine.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/375872572015-08-07T02:12:50Z2015-08-07T02:12:50ZCan't build asp.net solution !<div><p>I've figured out the solution though - you could retry nuget
restore few times until exit code is 0.</p>
<p>There is a simple batch for that: <a href="https://gist.github.com/FeodorFitsner/508b71250295590e6408">https://gist.github.com/FeodorFitsner/508b71250295590e6408</a></p>
<p>Place it into the root of your repo and use as (if .sln in the
root):</p>
<pre>
<code>nuget-restore</code>
</pre>
<p>or</p>
<pre>
<code>nuget-restore <solution.sln></code>
</pre>
<p>Hope that helps!</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/375872572015-08-07T13:13:20Z2015-08-07T13:13:20ZCan't build asp.net solution !<div><p>Hi Feodor,</p>
<p>That did the trick ;) Thanks a lot!</p>
<p>Just a quick question though: Do I always have to install bower
in my 'install scripts' or does it come with pre-installed ?</p>
<p>Cheers<br>
Andre</p>
<p>---- On Thu, 06 Aug 2015 23:12:51 -0300 Feodor Fitsner
<<a href="mailto:tender2+d5fe34820d@tenderapp.com">tender2+d5fe34820d@tenderapp.com</a>>
wrote ----</p></div>Andre Gallotag:help.appveyor.com,2012-11-13:Comment/375872572015-08-07T15:13:18Z2015-08-07T15:13:18ZCan't build asp.net solution !<div><p>That's great it worked! :)</p>
<p>Yes, bower should be installed all the time.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/375872572015-08-24T16:55:55Z2015-08-24T16:55:55ZCan't build asp.net solution !<div><p>Hi Feodor,</p>
<p>Unfortunately I'll have to bother you again with this. This
nuget restore problem is killing me! Although you have provided me
with a good workaround, nuget has been failing to restore packages
saying "unable to find version X of package Y." This is a new
error. What's worse, it doesn't fail the build, it continues with
the pipeline and fails at the end as it cannot put a package
together.</p>
<p>For every commit I make I have to run the same build a number of
times to get it pass this issue!</p>
<p>Can you make AppVeyor a little more robust when restoring nuget
packages? I understand that this might be outside of your control
however AppVeyor is really dependent on nuget and am sure this is
impacting a loft of your customers.</p>
<p>Thanks<br>
Andre</p>
<p>---- On Fri, 07 Aug 2015 10:13:04 -0300 Andre Gallo <<a href="mailto:andre.gallo@recmeup.com">andre.gallo@recmeup.com</a>>
wrote ----</p>
<p>Hi Feodor,</p>
<p>That did the trick ;) Thanks a lot!</p>
<p>Just a quick question though: Do I always have to install bower
in my 'install scripts' or does it come with pre-installed ?</p>
<p>Cheers<br>
Andre</p>
<p>---- On Thu, 06 Aug 2015 23:12:51 -0300 Feodor Fitsner
<<a href="mailto:tender2+d5fe34820d@tenderapp.com">tender2+d5fe34820d@tenderapp.com</a>>
wrote ----</p></div>Andre Gallotag:help.appveyor.com,2012-11-13:Comment/375872572015-08-24T17:31:08Z2015-08-24T17:31:08ZCan't build asp.net solution !<div><p>"Unable to find version X of package Y" is server-side nuget.org
error (meaning AppVeyor was able to connect but got error response
from nuget.org server) and I'm afraid there is nothing we can do
with that.</p>
<p>How do you call <code>nuget restore</code> command? If you call
it in "CMD" mode (or no <code>ps:</code> prefix in appveyor.yml)
then it should fail immediately if exit code is non-zero.</p>
<p>Instead of bare <code>nuget restore</code> command use this
batch with retries: <a href="http://www.appveyor.com/docs/nuget#restore-with-retries">http://www.appveyor.com/docs/nuget#restore-with-retries</a>
- works like a charm in 99% of cases.</p>
<p>Consider setting up build cache for <code>packages</code>
folder: <a href="http://www.appveyor.com/docs/nuget#use-build-cache-for-nuget-packages">
http://www.appveyor.com/docs/nuget#use-build-cache-for-nuget-packages</a></p>
<p>Hope that helps.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/375872572015-08-24T21:31:19Z2015-08-24T21:31:19ZCan't build asp.net solution !<div><p>I was already using your nuget-restore.cmd script. It's pretty
good.</p>
<p>Will enable package cache, thanks for the tip. And will also let
you know if there is anything problems with that.</p>
<p>Regards<br>
Andre</p></div>Andre Gallo