question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue while setting up the project

See original GitHub issue

I downloaded earlier release for .net core 2.1 and started making changes as per the readme file. I observed an error while running the command. I am pasting the entire errors here- Microsoft Windows [Version 10.0.17134.1184] © 2018 Microsoft Corporation. All rights reserved.

C:\Project\Sonar\Sample Application.NET Core Applications\eShopOnWeb-netcore2.1\eShopOnWeb-netcore2.1\src\Web>dotnet ef database update -c catalogcontext -p …/Infrastructure/Infrastructure.csproj -s Web.csproj info: Microsoft.EntityFrameworkCore.Infrastructure[10403] Entity Framework Core 2.1.14-servicing-32113 initialized ‘CatalogContext’ using provider ‘Microsoft.EntityFrameworkCore.InMemory’ with options: StoreName=Catalog System.InvalidOperationException: Unable to resolve service for type ‘Microsoft.EntityFrameworkCore.Migrations.IMigrator’. This is often because no database provider has been configured for this DbContext. A provider can be configured by overriding the DbContext.OnConfiguring method or by using AddDbContext on the application service provider. If AddDbContext is used, then also ensure that your DbContext type accepts a DbContextOptions<TContext> object in its constructor and passes it to the base constructor for DbContext. at Microsoft.EntityFrameworkCore.Internal.InternalAccessorExtensions.GetService[TService](IInfrastructure1 accessor) at Microsoft.EntityFrameworkCore.Infrastructure.AccessorExtensions.GetService[TService](IInfrastructure1 accessor) at Microsoft.EntityFrameworkCore.Design.DesignTimeServiceCollectionExtensions.<>c__DisplayClass1_0.<AddDbContextDesignTimeServices>b__7(IServiceProvider _) 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.VisitTransient(TransientCallSite transientCallSite, 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.ServiceProviderEngine.GetService(Type serviceType) at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType) at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetService[T](IServiceProvider provider) at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.EnsureServices(IServiceProvider services) at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.UpdateDatabase(String targetMigration, String contextType) at Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabase.<>c__DisplayClass0_1.<.ctor>b__0() at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action) Unable to resolve service for type ‘Microsoft.EntityFrameworkCore.Migrations.IMigrator’. This is often because no database provider has been configured for this DbContext. A provider can be configured by overriding the DbContext.OnConfiguring method or by using AddDbContext on the application service provider. If AddDbContext is used, then also ensure that your DbContext type accepts a DbContextOptions<TContext> object in its constructor and passes it to the base constructor for DbContext.

C:\Project\Sonar\Sample Application.NET Core Applications\eShopOnWeb-netcore2.1\eShopOnWeb-netcore2.1\src\Web>

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
AnanthaSubramaniancommented, Feb 4, 2020

Hi Fleming,

I haven’t been able to take a look at the suggestions. I will take couple of days to try out the suggestions as I am occupied with something else at this moment. I shall revert on this as soon as I try out the suggestions.

Thanks for following up.

Regards, Anantha

Get Outlook for Androidhttps://aka.ms/ghei36


From: Eric Fleming notifications@github.com Sent: Tuesday, February 4, 2020 3:06:25 AM To: dotnet-architecture/eShopOnWeb eShopOnWeb@noreply.github.com Cc: Anantha anantha.subramanian@outlook.com; Mention mention@noreply.github.com Subject: Re: [dotnet-architecture/eShopOnWeb] Issue while setting up the project (#351)

Hey @AnanthaSubramanianhttps://github.com/AnanthaSubramanian - have you had a chance to give this a try yet?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/dotnet-architecture/eShopOnWeb/issues/351?email_source=notifications&email_token=AKRTV5SV53A6IWSQNMY5IETRBCE5TA5CNFSM4KL3P2VKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKVPRUY#issuecomment-581630163, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AKRTV5TH2SPUC7T7FLJFGA3RBCE5TANCNFSM4KL3P2VA.

1reaction
fingers10commented, Jan 27, 2020

Entity Framework Core 2.1.14-servicing-32113 initialized ‘CatalogContext’ using provider ‘Microsoft.EntityFrameworkCore.InMemory’ with options: StoreName=Catalog System.InvalidOperationException: Unable to resolve service for type ‘Microsoft.EntityFrameworkCore.Migrations.IMigrator’. This is often because no database provider has been configured for this DbContext.

Looks like you are trying to do migration against InMemoryDatabase.

Make sure you,

  1. comment this line (InMemoryDatabase)
  2. uncomment this line (UseSqlServerDatabase)
  3. Select Infrastructure project in Package Manager Console.
  4. Apply Migrations and Update Database.
  5. Now run and see.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Project Issue Management - Identifying and Resolving Issues
If the issue goes unresolved, you risk creating unnecessary conflicts, delays, or even failure to produce your deliverable. Issues Versus Risks. Issues and ......
Read more >
9 Project Management Challenges and How to Overcome ...
1. Scope creep · 2. Lack of communication · 3. Lack of clear goals and success criteria · 4. Budgeting issues · 5....
Read more >
10 Common Project Management Challenges
Failure to set appropriate goals and objectives can lead to a whole host of issues, including poor resource and stakeholder management.
Read more >
8 Steps for Better Issue Management
Project issues happen; our 8 steps to better issue management show you how to identify and manage issues to keep your project on...
Read more >
"There was a problem setting up your project" message ...
Causes: There are two possible causes: The project itself cannot be created at the moment. The project was created but users cannot be...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found