Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Full .NET build error after installing EntityFramework.SqlServer (Multiple assemblies with equivalent identity have been imported) #2340

Closed
rowanmiller opened this issue Jun 5, 2015 · 11 comments
Assignees
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Milestone

Comments

@rowanmiller
Copy link
Contributor

  • Create a console app in VS2015
  • Install EntityFramework.SQL Server
  • Build

Build error

Multiple assemblies with equivalent identity have been imported: 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Collections.Concurrent\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Collections.Concurrent.dll' and 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.6\Facades\System.Collections.Concurrent.dll'. Remove one of the duplicate references. EFGetStarted.ConsoleApp C:\Users\rowmil\Documents\GitHub\EntityFramework.Docs\docs\getting-started\traditional-dotnet\sample\EFGetStarted.ConsoleApp\CSC

@bricelam
Copy link
Contributor

bricelam commented Jun 8, 2015

Looks like we're accidentally referencing a design-time facade in our nupkg. Easy to do since it's required for DNX to build.

@bricelam
Copy link
Contributor

bricelam commented Jun 8, 2015

We should consider creating a build verification test to catch these. (or DNX should play better with NuGet & MSBuild)

@bricelam
Copy link
Contributor

bricelam commented Jun 8, 2015

Filed aspnet/dnx#2031

@bricelam
Copy link
Contributor

bricelam commented Jul 6, 2015

This appears to be fixed using the latest tools and packages.

@bricelam bricelam closed this as completed Jul 6, 2015
@bricelam bricelam modified the milestones: 7.0.0-beta6, 7.0.0 Jul 6, 2015
@jderus
Copy link

jderus commented Sep 9, 2015

Can you be more specific on "the latest tools and packages" please?

I believe I am seeing this with ASP.NET 5 projects + EF 6.1.3 as well, but only in the Published application scenario. (running through VS works just fine) I would like to update dependencies so that it works once published, or the repro can be reduced and actionable.

@rowanmiller
Copy link
Contributor Author

Hey,

EF6 + EF7 in the same application is not supported. You end up trying to load two different versions of assemblies with the same names (which is not supported by the CLR).

~Rowan

@jderus
Copy link

jderus commented Sep 10, 2015

Im not using both. Just a dll built with 6.1.3, referenced via Nuget, in an ASP.NET 5 project.

@davidfowl
Copy link
Member

You might have other references that are breaking your packages. What does your project.json look like

@divega
Copy link
Contributor

divega commented Sep 10, 2015

You may think that you are not trying to use both but the EntityFramework.SqlServer the title refers to is a v7 package. The SQL Server provider never had its own package in EF 6.x. For EF 6.x you just need to install the EntityFramework package and you'll get the SQL Server provider alongside the core EntityFramewotk.dll assembly.

Can you detail your repro steps?

@jderus
Copy link

jderus commented Sep 14, 2015

@divega That could very well be the case, but how would it explain the differences in runtime behavior? Locally running it works just fine and it has all the new stuff installed. Publishing to a server doesn't work, and it has nothing new installed.

My steps are basically:

  1. Create an EF 6.1.3 database first dll and publish as a Nuget package
  2. Create an MVC6 API solution.
  3. Validate local run. Ok
  4. Validate publish and browse. Ok
  5. Set up a project in the API solution to consume the Nuget package from 1.
  6. Validate local run. Ok
  7. Validate publish and browse. FAIL.

@jderus
Copy link

jderus commented Sep 14, 2015

@davidfowl

Project that consumes the EF nuget package:

{
  "version": "0.0.2-alpha",
  "description": "Api.BusinessLogic",
  "authors": [ "jd" ],
  "tags": [ "" ],
  "projectUrl": "",
  "licenseUrl": "",

  "dependencies": {
    "DataModel": "0.0.2.0"
  },

  "frameworks": {
    "dnx451": { }
  }
}

Top level Web API project:

{
  "webroot": "wwwroot",
  "version": "0.0.2-alpha",

  "dependencies": {
    "Microsoft.AspNet.Mvc": "6.0.0-beta6",
    "Microsoft.AspNet.Server.IIS": "1.0.0-beta6",
    "Microsoft.AspNet.Server.WebListener": "1.0.0-beta6",
    "Microsoft.AspNet.StaticFiles": "1.0.0-beta6",

    "System.Net.Http": "4.0.0",

    "Swashbuckle": "6.0.0-beta6",
    "System.Reflection": "4.0.10-beta-22605",
    "System.Xml.XPath.XmlDocument": "4.0.0-beta-22816",
    "System.Reflection.TypeExtensions": "4.0.0-beta-23019",
    "System.Reflection.Extensions": "4.0.0-beta-23019",

    "Api.BusinessLogic": "0.0.2-alpha"


  },

  "commands": {
    "web": "Microsoft.AspNet.Hosting --config hosting.ini"
  },

  "frameworks": {
    "dnx451": { }
  },

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

smitpatel added a commit that referenced this issue Sep 4, 2020
smitpatel added a commit that referenced this issue Sep 4, 2020
@ajcvickers ajcvickers added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Oct 15, 2022
@ajcvickers ajcvickers modified the milestones: 1.0.0-beta6, 1.0.0 Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Projects
None yet
Development

No branches or pull requests

6 participants