4

Following an Update-Package run of my solution, my ASP.Net Core projects are cluttered with warnings following the pattern outlined below.

I am at a loss as to identify the root cause of this problem.

Pattern:

Dependency Conflict. [project name] [project version] expected [dependency name] >= [registered version] but received [lower version]

Dependency specified was [dependency name] >= [registered version] but ended up with [dependency name] [lower version]

Example: I have this warning on dependency Microsoft.Extensions.Logging v1.1.1:

Dependency Conflict. Statistics 1.0.0 expected Microsoft.Extensions.Logging >= 1.1.1 but received 1.1.0

Dependency specified was Microsoft.Extensions.Logging >= 1.1.1 but ended up with Microsoft.Extensions.Logging 1.1.0

It is perhaps fair to note that prior to running Update-Packages cmdlet, the project.json file did indeed reference the v1.1.0 of Microsoft.Extensions.Logging.

Post-update project.json file:

{
  "buildOptions": {
    "emitEntryPoint": true,
    "preserveCompilationContext": true,
    "xmlDoc": true,
    "nowarn": [ "CS1591" ]
  },
  "dependencies": {
    "BusinessEntities": "1.0.0-*",
    "IdentityServer4.AccessTokenValidation": "1.1.0",
    "Ioc": "1.0.0-*",
    "Microsoft.AspNet.WebApi.Client": "5.2.3",
    "Microsoft.AspNetCore.Diagnostics": "1.1.1",
    "Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.1.1",
    "Microsoft.AspNetCore.Mvc": "1.1.2",
    "Microsoft.AspNetCore.Routing": "1.1.1",
    "Microsoft.AspNetCore.Server.IISIntegration": "1.1.1",
    "Microsoft.AspNetCore.Server.Kestrel": "1.1.1",
    "Microsoft.AspNetCore.Server.Kestrel.Https": "1.1.1",
    "Microsoft.Extensions.Configuration.CommandLine": "1.1.1",
    "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.1",
    "Microsoft.Extensions.Configuration.FileExtensions": "1.1.1",
    "Microsoft.Extensions.Configuration.Json": "1.1.1",
    "Microsoft.Extensions.Logging": "1.1.1",
    "Microsoft.Extensions.Logging.Console": "1.1.1",
    "Microsoft.Extensions.Logging.Debug": "1.1.1",
    "Microsoft.Extensions.Options.ConfigurationExtensions": "1.1.1",
    "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.1.0",
    "Swashbuckle.AspNetCore": "1.0.0-rc1",
    "Swashbuckle.AspNetCore.Swagger": "1.0.0-rc1",
    "Swashbuckle.AspNetCore.SwaggerGen": "1.0.0-rc1",
    "Swashbuckle.AspNetCore.SwaggerUi": "1.0.0-rc1",
    "System.Xml.XmlDocument": "4.3.0",
    "Unity": "4.0.1",
    "WebApiCommon": "1.0.0-*"
  },
  "frameworks": {
    "netcoreapp1.1": {
      "dependencies": {
        "Microsoft.NETCore.App": {
          "type": "platform",
          "version": "1.1.1"
        }

      },
      "imports": [
        "dotnet5.6",
        "portable-net45+win8"
      ]
    }
  },
  "publishOptions": {
    "include": [
      "wwwroot",
      "**/*.cshtml",
      "appsettings.json",
      "web.config"
    ]
  },
  "runtimeOptions": {
    "configProperties": {
      "System.GC.Server": true
    }
  },
  "scripts": {
    "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
  },
  "tools": {
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.1.0-preview4-final",
    "Microsoft.DotNet.Watcher.Tools": "1.1.0-preview4-final"
  }
}
Nate Barbettini
  • 51,256
  • 26
  • 134
  • 147
Sigurd Garshol
  • 1,376
  • 3
  • 15
  • 36

2 Answers2

1

Your project.json looks fine to me, unless your BusinessEntities, Ioc, or WebApiCommon packages have references to older versions of the packages you are getting warnings for. Since I can't see the list of dependencies for those packages, I can't be sure.

If those packages aren't the source of the warnings, then my guess is that your answer about restarting Visual Studio did the trick. Visual Studio losing sync with the current set of package errors or warnings was pretty common on the beta tooling for me.

To completely rule out Visual Studio, do dotnet restore and dotnet build on the command line inside of your project folder. You can treat the messages and errors you see there as the authoritative source.

Nate Barbettini
  • 51,256
  • 26
  • 134
  • 147
0

Edit: The project structure displayed above does not seem to be relevant as the project.json file has been replaced by a more "traditional" xml-style .csproj file.

Sigurd Garshol
  • 1,376
  • 3
  • 15
  • 36