dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.45k stars 10.03k forks source link

Deployment from Github to Azure fails(Unable to find version “xxxxx” of package “yyyyy”) #1895

Closed AlexGuedes1986 closed 6 years ago

AlexGuedes1986 commented 7 years ago

I'm trying to deploy my website from Github to Azure but there are some errors showing up every time I try to do it, this is part of the log from Azure:

Command: "D:\home\site\deployments\tools\deploy.cmd"
Handling ASP.NET Core Web Application deployment with MSBuild.
MSBuild auto-detection: using msbuild version '14.0' from 'D:\Program Files (x86)\MSBuild\14.0\bin'.
Restoring NuGet package Microsoft.Extensions.Caching.Abstractions.1.0.0.
Restoring NuGet package Microsoft.Extensions.Caching.Memory.1.0.0.
Restoring NuGet package Microsoft.Extensions.DependencyInjection.1.0.0.
WARNING: Unable to find version '1.0.0' of package 'Microsoft.Extensions.Caching.Abstractions'.
  D:\home\.nuget: Package 'Microsoft.Extensions.Caching.Abstractions.1.0.0' is not found on source 'D:\home\.nuget'.
  https://api.nuget.org/v3/index.json: Could not find file 'D:\home\.nuget\microsoft.extensions.caching.abstractions\1.0.0\microsoft.extensions.caching.abstractions.1.0.0.nupkg'.

Then after the Warning messages, these other messages are showed:

Restoring packages for D:\home\site\repository\src\LIGMarine\project.json...
Restoring packages for tool 'BundlerMinifier.Core' in D:\home\site\repository\src\LIGMarine\project.json...
Restoring packages for tool 'Microsoft.AspNetCore.Razor.Tools' in D:\home\site\repository\src\LIGMarine\project.json...
Restoring packages for tool 'Microsoft.AspNetCore.Server.IISIntegration.Tools' in D:\home\site\repository\src\LIGMarine\project.json...
Committing restore...
Writing lock file to disk. Path: D:\home\site\repository\src\LIGMarine\project.lock.json
D:\home\site\repository\src\LIGMarine\LIGMarine.xproj
Restore completed in 5151ms.

And then comes the error messages:

Errors in packages.config projects
    Unable to find version '1.0.0' of package 'Microsoft.Extensions.Caching.Abstractions'.
      D:\home\.nuget: Package 'Microsoft.Extensions.Caching.Abstractions.1.0.0' is not found on source 'D:\home\.nuget'.
      https://api.nuget.org/v3/index.json: Could not find file 'D:\home\.nuget\microsoft.extensions.caching.abstractions\1.0.0\microsoft.extensions.caching.abstractions.1.0.0.nupkg'.

Feeds used:
    D:\home\.nuget
      D:\home\.nuget: Package 'System.Interactive.Async.3.0.0' is not found on source 'D:\home\.nuget'.
      https://api.nuget.org/v3/index.json: Could not find file 'D:\home\.nuget\system.interactive.async\3.0.0\system.interactive.async.3.0.0.nupkg'

This is a resume of the Azure log, I have read about this errors and I have created a Nuget.Config file, but it doesn't changes anything.

This is the code that I have inside the Nuget.Config file:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageRestore>
    <add key="enabled" value="True" />
    <add key="automatic" value="True" />
  </packageRestore>
  <packageSources>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
  </packageSources>
  <disabledPackageSources />
  <activePackageSource>
    <add key="All" value="(Aggregate source)" />
  </activePackageSource>
</configuration>

Totally, these are the packages that cannot be found and that are displayed within those errors:

Microsoft.Extensions.Caching.Abstractions
Microsoft.Extensions.Caching.Memory
Microsoft.Extensions.DependencyInjection
System.Interactive.Async
System.Linq
System.Linq.Expressions
System.Linq.Queryable
System.Globalization
System.Reflection
System.ObjectModel
System.Resources.ResourceManager
System.Reflection.Extensions
System.Runtime
System.Runtime.Extensions
System.Runtime.InteropServices
Microsoft.Extensions.DependencyInjection.Abstractions

System.Threading.Tasks
System.Threading.Tasks.4.0.11
Microsoft.Extensions.Logging.Abstractions
Microsoft.Extensions.Logging.Abstractions.1.0.0
Microsoft.Extensions.Logging
Microsoft.Extensions.Options
Microsoft.Extensions.Primitives
Remotion.Linq
Newtonsoft.Json
System.Collections
System.Collections.Immutable
System.Diagnostics.Debug
System.Diagnostics.DiagnosticSource
System.Collections.Concurrent
System.ComponentModel
System.Threading

What's going on?

AlexGuedes1986 commented 7 years ago

This is what I have inside project.json:

{
  "dependencies": {
    "AWSSDK": "2.3.55.2",
    "AWSSDK.DynamoDBv2": "3.3.0.2",
    "Dropbox.Api": "3.6.0",
    "EntityFramework": "6.1.3",
    "jQuery.Validation": "1.16.0",
    "Microsoft.ApplicationInsights.AspNetCore": "1.0.0",
    "Microsoft.AspNet.Mvc": "5.2.3",
    "Microsoft.AspNetCore.Diagnostics": "1.0.0",
    "Microsoft.AspNetCore.Mvc": "1.0.0",
    "Microsoft.AspNetCore.Razor.Tools": {
      "version": "1.0.0-preview2-final",
      "type": "build"
    },
    "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
    "Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
    "Microsoft.AspNetCore.StaticFiles": "1.0.0",
    "Microsoft.Extensions.Caching.Memory": "1.0.0",
    //"Microsoft.EntityFrameworkCore": "1.0.1",
    //"Microsoft.EntityFrameworkCore.SqlServer": "1.0.1",
    "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
    "Microsoft.Extensions.Configuration.Json": "1.0.0",
    "Microsoft.Extensions.Logging": "1.0.0",
    "Microsoft.Extensions.Logging.Console": "1.0.0",
    "Microsoft.Extensions.Logging.Debug": "1.0.0",
    "Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
    "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0",
    "MongoDB.Bson": "2.3.0",
    "MongoDB.Driver": "2.3.0"
  },

  "tools": {
    "BundlerMinifier.Core": "2.0.238",
    "Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final",
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
  },

  "frameworks": {
    "net452": {
      "dependencies": {
        "SharedClasses": {
          "target": "project"
        }
      },
      "frameworkAssemblies": {
        "System.Net": "4.0.0.0"
      }
    }
  },

  "buildOptions": {
    "emitEntryPoint": true,
    "preserveCompilationContext": true
  },

  "publishOptions": {
    "include": [
      "wwwroot",
      "Views",
      "Areas/**/Views",
      "appsettings.json",
      "web.config"

    ]
  },

  "scripts": {
    "prepublish": [ "bower install", "dotnet bundle" ],
    "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
  }
}
aspnet-hello commented 6 years ago

This issue is being closed because it has not been updated in 3 months.

We apologize if this causes any inconvenience. We ask that if you are still encountering this issue, please log a new issue with updated information and we will investigate.