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

Unable to build with EF 2.1.300-rc1-008673 #469

Closed
mdepa opened this issue May 20, 2018 · 8 comments
Closed

Unable to build with EF 2.1.300-rc1-008673 #469

mdepa opened this issue May 20, 2018 · 8 comments

Comments

@mdepa
Copy link

mdepa commented May 20, 2018

Running the build script, the build fails with following error:

No suitable constructor found for entity type 'Uri'. The following parameters could not be bound to properties of the entity: 'flags', 'uriParser', 'uri', 'uriString', 'uriString', 'dontEscape', 'baseUri', 'relativeUri', 'dontEscape', 'uriString', 'uriKind', 'baseUri', 'relativeUri', 'serializationInfo', 'streamingContext', 'baseUri', 'relativeUri'.

Linux thinkMachine 4.4.0-124-generic #148-Ubuntu SMP Wed May 2 13:00:18 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

@thiennn
Copy link
Contributor

thiennn commented May 21, 2018

Did you have .net core sdk 2.1-rc installed? and please include the full stacktrace

@thiennn thiennn closed this as completed May 29, 2018
@mdepa
Copy link
Author

mdepa commented May 29, 2018

Hi @thiennn,

sorry for the late answer. Yes, I've sdk 2.1-rc1 installed, build is 8673.

the stack trace is the following:

System.InvalidOperationException: No suitable constructor found for entity type 'Uri'. The following parameters could not be bound to properties of the entity: 'flags', 'uriParser', 'uri', 'uriString', 'uriString', 'dontEscape', 'baseUri', 'relativeUri', 'dontEscape', 'uriString', 'uriKind', 'baseUri', 'relativeUri', 'serializationInfo', 'streamingContext', 'baseUri', 'relativeUri'.
at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ConstructorBindingConvention.Apply(InternalModelBuilder modelBuilder)
at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ConventionDispatcher.ImmediateConventionScope.OnModelBuilt(InternalModelBuilder modelBuilder)
at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ConventionDispatcher.OnModelBuilt(InternalModelBuilder modelBuilder)
at Microsoft.EntityFrameworkCore.Metadata.Internal.Model.Validate()
at Microsoft.EntityFrameworkCore.Infrastructure.ModelSource.CreateModel(DbContext context, IConventionSetBuilder conventionSetBuilder, IModelValidator validator)
at Microsoft.EntityFrameworkCore.Infrastructure.ModelSource.<>c__DisplayClass5_0.b__1()
at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode) at System.Lazy1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
at System.Lazy1.CreateValue() at Microsoft.EntityFrameworkCore.Infrastructure.ModelSource.GetModel(DbContext context, IConventionSetBuilder conventionSetBuilder, IModelValidator validator) at Microsoft.EntityFrameworkCore.Internal.DbContextServices.CreateModel() at Microsoft.EntityFrameworkCore.Internal.DbContextServices.get_Model() at Microsoft.EntityFrameworkCore.Infrastructure.EntityFrameworkServicesBuilder.<>c.<TryAddCoreServices>b__7_1(IServiceProvider p) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, ServiceProviderEngineScope scope) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(IServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(IServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, ServiceProviderEngineScope scope) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(IServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(IServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass1_0.<RealizeService>b__0(ServiceProviderEngineScope scope) at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope) at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType) 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.Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure<System.IServiceProvider>.get_Instance() at Microsoft.EntityFrameworkCore.Internal.InternalAccessorExtensions.GetService[TService](IInfrastructure1 accessor)
at Microsoft.EntityFrameworkCore.Infrastructure.AccessorExtensions.GetService[TService](IInfrastructure1 accessor) at Microsoft.EntityFrameworkCore.Design.Internal.DbContextOperations.CreateContext(Func1 factory)
at Microsoft.EntityFrameworkCore.Design.Internal.DbContextOperations.CreateContext(String contextType)
at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.AddMigration(String name, String outputDir, String contextType)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.AddMigrationImpl(String name, String outputDir, String contextType)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.AddMigration.<>c__DisplayClass0_1.<.ctor>b__0()
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.<>c__DisplayClass3_0`1.b__0()
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)
No suitable constructor found for entity type 'Uri'. The following parameters could not be bound to properties of the entity: 'flags', 'uriParser', 'uri', 'uriString', 'uriString', 'dontEscape', 'baseUri', 'relativeUri', 'dontEscape', 'uriString', 'uriKind', 'baseUri', 'relativeUri', 'serializationInfo', 'streamingContext', 'baseUri', 'relativeUri'.

@thiennn
Copy link
Contributor

thiennn commented May 30, 2018

The error looks weird. Did you make any change on the source code? Could you describle steps you have done. We haven't seen this kind of error. We have Ubuntu build on CI

@mdepa
Copy link
Author

mdepa commented May 30, 2018

Well, everything was working, ,then I performed a dist upgrade sequence and the system updated dotnet sdk to 2.1.200-preview.

At that point I started to face this error: "The current .NET SDK does not support targeting .NET Core 2.1. Either target .NET Core 2.0 or lower, or use a version of the .NET SDK that supports .NET Core 2.1." on build.

I removed dotnet sdk and installed the latest one: 2.1.300-rc1. The build now is ok, but I've issues in building the model.

I suspect it's something related to this one: dotnet/efcore#11074

If you go down 'til the boxofnotgoodery's comment, he is mentioning System.Uri as a possible issue's root cause.
However I'm very new to EF core, so I get lost on the details.

Anyhow, I badly suspect this could be an EF issue and not a simplecommerce's one, I've opened the issue just to track down that it's currently not working with 2.1.300-rc1.

I was wondering too if there's a way to signal this problem to the EF's people.

@mdepa
Copy link
Author

mdepa commented May 30, 2018

UH, just to answer to your question: no I've not any changes. I've downloaded the git repo and rebuild.
What I made was a sequence of updates on the dotnet SDK installation (many upgrades since 2.1.4).

@thiennn
Copy link
Contributor

thiennn commented May 31, 2018

Now we have upgraded to 2.1.0 RTM. Please install the official 2.1 SDK (v2.1.300) and try again

@mdepa
Copy link
Author

mdepa commented Jun 1, 2018

I'll give it a try once back at home.

@mdepa
Copy link
Author

mdepa commented Jun 2, 2018

Hi @thiennn,

just upgrading to final dotnet 2.1.0 wasn't enough, I had to uninstall dotnet completely. Once reinstalled I performed a full clean/rebuild cycle and everything is fine.

Thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants