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

Facing 'multiple assemblies with equivalent identity' on .NET 4.5 with latest build #3407

Closed
htuomola opened this issue Oct 12, 2015 · 10 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

@htuomola
Copy link

Hi, I just updated (or tried to) the solution to 7.0.0-rc1-15945. Looks like the System.Diagnostics.Tracing.Telemetry declares dependencies just for .NET 5.0 and thus it pulled in System.Threading.Tasks v.4.0.0-beta-23019 and that one added System.Threading and System.Runtime.

As a result, I get build errors "Multiple assemblies with equivalent identity have been imported: '..\packages\System.Threading.4.0.10-beta-22605\lib\net45\System.Threading.dll' and 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5.2\Facades\System.Threading.dll'. Remove one of the duplicate references."

Interestingly, I was able to remove all three packages after they had been installed. Not sure if this is related or a consequence of me tinkering with the packages, but post-upgrade the app fails to start because of System.EntryPointNotFoundException: Entry point was not found. with stack trace:

at Microsoft.Data.Entity.Infrastructure.IAccessor1.get_Service() at Microsoft.Framework.DependencyInjection.SqlServerEntityFrameworkServicesBuilderExtensions.AddSqlServer(EntityFrameworkServicesBuilder builder) at Microsoft.Data.Entity.Internal.ServiceProviderCache.GetOrAdd(IDbContextOptions options) at Microsoft.Data.Entity.DbContext.InitializeServices(IServiceProvider serviceProvider, DbContextOptions options) at Microsoft.Data.Entity.Internal.LazyRef1.get_Value()
at Microsoft.Data.Entity.DbContext.get_ServiceProvider()
at Microsoft.Data.Entity.DbContext.b__12_1()
at Microsoft.Data.Entity.Internal.LazyRef`1.get_Value()
at Microsoft.Data.Entity.DbContext.Set()

@Maverik
Copy link

Maverik commented Oct 12, 2015

I had the exact same problem that was solved by removing all EF nuget stuff and then just pulling in EntityFramework.MicrosoftSqlServer (they renamed the nuget from EntityFramework.SqlServer). Thanks to Maurycy for that tip about nuget rename.

@rowanmiller
Copy link
Contributor

@htuomola are you able to reproduce this issue on a clean solution/project?

@natemcmaster
Copy link
Contributor

The can also be caused by having a version of Microsoft.AspNet.Identity.EntityFramework and EntityFramework.(Microsoft)SqlServer that do not agree. If you are using EntityFramework.MicrosoftSqlServer (the most-current package name), make sure you are using Identity >= build 15850. (cref #3331)

@htuomola
Copy link
Author

@rowanmiller which one, the assembly identity error or the entry point exception? I am able to repro the former by just creating a new empty .NET 4.5.2 console app and calling Install-package -version 7.0.0-rc1-15945 Entityframework.Commands. After that the project doesn't build due to the CS1703 "Multiple assemblies with equivalent identity" error.

The exception on entry point looks like to have been caused by the solution still using and old version of EntityFramework.SqlServer package. Due to the rename Nuget wasn't able to suggest an update. Uninstalling that and installing EntityFramework.MicrosoftSqlServer fixed that part. Thanks to @venomed for the tip.

@rowanmiller rowanmiller self-assigned this Oct 16, 2015
@rowanmiller
Copy link
Contributor

Confirmed that this repros for me too, just Install-package -Pre Entityframework.Commands -Source http://myget.org/F/aspnetvnext on a standard .NET 4.5.2 console app. Assigning to @bricelam to look at a fix.

@rowanmiller rowanmiller added this to the 7.0.0-rc1 milestone Oct 16, 2015
@rowanmiller rowanmiller assigned bricelam and unassigned rowanmiller Oct 16, 2015
@bricelam
Copy link
Contributor

I suspect it's caused by our upgrade of immutable collections. I'll dig into it on Monday

@htuomola
Copy link
Author

For what it's worth, here's the nuget output for this (using EntityFramework.Relational is enough for repro):

PM> Install-package -Pre EntityFramework.Relational -Source http://myget.org/F/aspnetvnext -whatif

Attempting to gather dependencies information for package 'Entityframework.Relational.7.0.0-rc1-15945' with respect to project 'EFTest.Issue3407_2', targeting '.NETFramework,Version=v4.5.2'
Attempting to resolve dependencies for package 'Entityframework.Relational.7.0.0-rc1-15945' with DependencyBehavior 'Lowest'
Resolving actions to install package 'Entityframework.Relational.7.0.0-rc1-15945'
Resolved actions to install package 'Entityframework.Relational.7.0.0-rc1-15945'
Install Ix-Async 1.2.5
Install Microsoft.Extensions.Configuration.Abstractions 1.0.0-rc1-15696
Install Microsoft.Extensions.Configuration 1.0.0-rc1-15696
Install Microsoft.Extensions.Configuration.Binder 1.0.0-rc1-15696
Install Microsoft.Extensions.DependencyInjection.Abstractions 1.0.0-rc1-15672
Install Microsoft.Extensions.DependencyInjection 1.0.0-rc1-15672
Install Microsoft.Extensions.Logging.Abstractions 1.0.0-rc1-15673
Install Microsoft.Extensions.Logging 1.0.0-rc1-15673
Install Microsoft.Extensions.OptionsModel 1.0.0-rc1-15671
Install Microsoft.Extensions.Primitives 1.0.0-rc1-15718
Install Microsoft.Extensions.Caching.Abstractions 1.0.0-rc1-15688
Install Microsoft.Extensions.Caching.Memory 1.0.0-rc1-15688
Install Remotion.Linq 2.0.0-beta-002
Install System.Collections.Immutable 1.1.36
Install EntityFramework.Core 7.0.0-rc1-15945
Install System.Runtime 4.0.10-beta-23019
Install System.Threading.Tasks 4.0.0-beta-23019
Install System.Threading 4.0.10-beta-22605
Install System.Diagnostics.Tracing.Telemetry 4.0.0-beta-23405
Install EntityFramework.Relational 7.0.0-rc1-15945

If the package installation order can be used as a sign of dependencies, I think this is due to EntityFramework.Relational depending on System.Diagnostics.Tracing.Telemetry. That only defines .Net 5.0 dependencies, at least for the latest package. Just my 2 cents. :)

@bricelam
Copy link
Contributor

This appears to be fixed now. Please re-open if you're still having problems.

@mailtoshafaqat
Copy link

I have this error any one have idea about this what i do ?
Error CS1703 Multiple assemblies with equivalent identity have been imported: 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\mscorlib.dll' and 'C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll'. Remove one of the duplicate references. HeyXamarin.Droid c:\users\alirana\documents\visual studio 2015\Projects\HeyXamarin\HeyXamarin\HeyXamarin.Droid\CSC

@ajcvickers
Copy link
Member

@mailtoshafaqat This issue tracked by this item is marked as fixed. If you feel there is still some issue here, then please file a new bug providing full details of the issue and how to reproduce it.

@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-rc1, 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

7 participants