1
votes

I have an ASP.NET 5.0 solution with three projects

  1. MVC project
  2. Data Access project
  3. Entities defnitions

after trying to upgrade the projects from beta-8 of ASP.NET 5 and EF 7 to RC1-final I get the following error (which didn't yield anything on any search anywhere I looked).

****Error: Error CS1705 Assembly 'EntityFramework.Core' with identity 'EntityFramework.Core, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' uses 'System.Linq.Expressions, Version=4.0.11.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' which has a higher version than referenced assembly 'System.Linq.Expressions' with identity 'System.Linq.Expressions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' ASS.DomainDataModel****

I tried to load different version of System.Linq via the Package Manager Console, targeting all three projects and also removed System.Linq from the project.json files of all projects and added it back in, trying different version there too. I'm getting more and more confused the longer I try to sort this out. I guess I'm missing something totally obvious...

As suggested, here's the content of the three project.json files

MVC Project:

{
  "webroot": "wwwroot",
  "version": "1.0.0-*",

  "dependencies": {
    "Microsoft.AspNet.Diagnostics": "1.0.0-rc1-final",
    "Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final",
    "Microsoft.AspNet.Mvc": "6.0.0-rc1-final",
    "Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final",
    "Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final",
    "Microsoft.Extensions.Logging.Debug": "1.0.0-rc1-final",
    "Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-rc1-final",
    "System.Linq.Parallel": "4.0.1-beta-23516", 
    "ASS.DomainClasses": "1.0.0-*",
    "ASS.DomainDataModel": "1.0.0-*"
  },

  "commands": {
    "web": "Microsoft.AspNet.Server.Kestrel",
    "ef": "EntityFramework.Commands"
  },

  "frameworks": {
    "dnx451": {
      "dependencies": {
        "System.Linq.Expressions": "4.0.11-beta-23516"
      }
    },
    "dnxcore50": {
      "dependencies": {
        "System.Linq.Expressions": "4.0.10"
      }
    }
  },

  "exclude": [
    "wwwroot",
    "node_modules",
    "bower_components"
  ],
  "publishExclude": [
    "node_modules",
    "bower_components",
    "**.xproj",
    "**.user",
    "**.vspscc"
  ]
}

Data Access project:

{
  "version": "1.0.0-*",
  "description": "ASS.DomainDataModel Class Library",
  "tags": [ "" ],
  "projectUrl": "",
  "licenseUrl": "",

  "frameworks": {
    "dnx451": {
      "dependencies": {
        "System.Linq.Expressions": "4.0.11-beta-23516"
      }
    },
    "dnxcore50": {
      "dependencies": {
      }
    }
  },

  "dependencies": {
    "ASS.DomainClasses": "1.0.0-*",
    "Microsoft.Extensions.PlatformAbstractions": "1.0.0-rc1-final",
    "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0-rc1-final",
    "Microsoft.Extensions.Configuration.FileExtensions": "1.0.0-rc1-final",
    "Microsoft.Extensions.Configuration.Json": "1.0.0-rc1-final",
    "EntityFramework.Core": "7.0.0-rc1-final",
    "EntityFramework.Commands": "7.0.0-rc1-final",
    "EntityFramework.MicrosoftSqlServer": "7.0.0-rc1-final",
    "EntityFramework.Relational": "7.0.0-rc1-final"
  },

    "commands": {
    "ef": "EntityFramework.Commands"
  }
}

Entities def project:

{
  "version": "1.0.0-*",
  "description": "ASS.DomainClasses Class Library",
  "tags": [ "" ],
  "projectUrl": "",
  "licenseUrl": "",

  "frameworks": {
    "dnx451": {
      "dependencies": {
        "System.Linq.Expressions": "4.0.11-beta-23516"
      }
    },
    "dnxcore50": {
      "dependencies": {
        "Microsoft.CSharp": "4.0.1-beta-23516",
        "System.Collections": "4.0.11-beta-23516",
        "System.Linq.Expressions": "4.0.10",
        "System.Runtime": "4.0.21-beta-23516",
        "System.Threading": "4.0.11-beta-23516"
      }
    }
  }
}
1
Typically with errors like this you have to go into your web.config file and change all the places where System.Linq.Expressions is used to refer to the newer version number.StriplingWarrior
I think you should add the project.json files for all 3 of your projects to your question to get help with this type of problemJoe Audette
thanks guys. Adding the json files did even help me to get a better overview. @StriplingWarrior, ASP.NET 5 is no longer using the web.config for these things. Instead it uses json files to configure the application.Olaf D.

1 Answers

1
votes

There is a subtle difference between "dependencies" and "frameworkAssemblies" in project.json. Your "dnx451" framework is using the packaged version of System.Linq.Expressions. It is more likely you need to specify the framework assembly. (Guessing as I don't know your project's exact requirements.)

See What is the difference between 'dependencies' and 'frameworkAssemblies' in project.json?

Also, this could be due to incompatibilities in ASS.DomainDataModel.