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

Issue with running any application with EFCore #13956

Closed
ravenboilinux opened this issue Nov 14, 2018 · 11 comments
Closed

Issue with running any application with EFCore #13956

ravenboilinux opened this issue Nov 14, 2018 · 11 comments

Comments

@ravenboilinux
Copy link

Issue with loading the efcore dlls. Everytime I create a new project with efcore

Exception message: Could not load type 'System.ComponentModel.DataAnnotations.Schema.InversePropertyAttribute' from assembly 'System.ComponentModel.Annotations, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
Stack trace:
   at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.CoreConventionSetBuilder.CreateConventionSet()
   at Microsoft.EntityFrameworkCore.Infrastructure.ModelSource.CreateConventionSet(IConventionSetBuilder conventionSetBuilder)
   at Microsoft.EntityFrameworkCore.Infrastructure.ModelSource.CreateModel(DbContext context, IConventionSetBuilder conventionSetBuilder, IModelValidator validator)
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at Microsoft.EntityFrameworkCore.Internal.DbContextServices.CreateModel()
   at Microsoft.EntityFrameworkCore.Internal.DbContextServices.get_Model()
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass1_0.<RealizeService>b__0(ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
   at Microsoft.EntityFrameworkCore.DbContext.get_DbContextDependencies()
   at Microsoft.EntityFrameworkCore.DbContext.get_InternalServiceProvider()
   at Microsoft.EntityFrameworkCore.DbContext.get_DbContextDependencies()
   at Microsoft.EntityFrameworkCore.DbContext.get_Model()
   at Microsoft.EntityFrameworkCore.Internal.InternalDbSet`1.get_EntityType()
   at Microsoft.EntityFrameworkCore.Internal.InternalDbSet`1.get_EntityQueryable()
   at Microsoft.EntityFrameworkCore.Internal.InternalDbSet`1.System.Linq.IQueryable.get_Provider()
   at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.Include[TEntity,TProperty](IQueryable`1 source, Expression`1 navigationPropertyPath)
   at MGFConfiguration.MGFConfigurationProvider.Load() in C:\Users\micha\source\repos\InnerSanctum\Servers\src\Config\MGFConfiguration\MGFConfigurationProvider.cs:line 30
   at Microsoft.Extensions.Configuration.ConfigurationRoot..ctor(IList`1 providers)
   at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build()
   at MGF_Photon.PhotonApplication.Setup() in C:\Users\micha\source\repos\InnerSanctum\Servers\src\MGF.Photon\PhotonApplication.cs:line 69
   at Photon.SocketServer.ApplicationBase.PhotonHostRuntimeInterfaces.IPhotonControl.OnPhotonRunning()
   at PhotonHostRuntime.PhotonDomainManager.PhotonPlainAppDomainBehavior.PhotonRunning()
   at PhotonHostRuntime.PhotonDomainManager.PhotonRunning()

Steps to reproduce

Create new solution .net framework
Complete the steps with Get started .net framework- new database
run the project
Here is a sample project for testing

Further technical details

EF Core version: 2.1.4
Database Provider: Microsoft.EntityFrameworkCore.SqlServer
Operating system: Window 10 Pro
IDE: Visual Studio 2017 15.8.2

@ajcvickers
Copy link
Member

@ravenboilinux Duplicate of #13268

@joperezr
Copy link
Member

I'm not convinced that this is a dupe, this problem seems different. @ravenboilinux looks like I can't reopen the issue on this repo, can you reopen it so we can continue the investigation here please?

@joperezr
Copy link
Member

Also, as the next step of the investigation, if you could do either one of this two things it would be great:

1.- If you could provide a repro project I can try debugging the issue myself. (ideal)
2.- If you can't, then do you mind attaching the debugger on it and see which System.ComponentModel.Annotations.dll you are using? I would like to take a peek at that dll since it looks like it might have an incorrect type-forward.

@ravenboilinux
Copy link
Author

Here is the link to the repo that msbuild.binlog came from

The solution file is InnerSanctum.sln under the servers folder. To easy test the issue I could recommend to run the TestDatabase Project vs the current startup project. The current startup project requires you to have the Photon Server sdk, from Exit Games, installed at the root of the C drive.

@ravenboilinux
Copy link
Author

any news on this issues?

@joperezr
Copy link
Member

we haven't yet got the chance to debug this since we are now engaged with the 3.0 preview bugs, but this is definitely on my backlog so I will come back with an answer soon.

@ravenboilinux
Copy link
Author

@joperezr any news with issue?

@joperezr
Copy link
Member

joperezr commented Jan 2, 2019

No news yet. Usually for issues like this we ask for simplified repros so that we can easily get a repro project and diagnose what is wrong. In your case, it is a fairly big project which also has some dependencies on external sdks. Is it at all possible to simplify the repro project?

@ajcvickers
Copy link
Member

Closing this in favor of https://github.com/dotnet/corefx/issues/33643 or some other new issue filed where it should go, since this is external to the EF code.

@ravenboilinux
Copy link
Author

@ajcvickers
This is using the .net framework not corefx so that ticket would useless for our team.

@ajcvickers
Copy link
Member

@ravenboilinux All the cases in that issue are also targeting .NET Framework.

@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants