title: Not able to scaffold with dotnet ef core on mac
body: <p>I'm trying to use .net core to reverse engineer model classes from existing database on my MAC. The database is running in a VM with windows and I am able to connect to it from osx.</p>
  
  <p>In my project.json I have the following:</p>
  
  <pre><code>"dependencies": {
      "Microsoft.NETCore.App": {
        "version": "1.0.1",
        "type": "platform"
      },
      "Microsoft.AspNetCore.AngularServices": "1.0.0-*",
      "Microsoft.AspNetCore.Diagnostics": "1.0.0",
      "Microsoft.AspNetCore.Mvc": "1.0.1",
      "Microsoft.AspNetCore.Razor.Tools": {
        "version": "1.0.0-preview2-final",
        "type": "build"
      },
      "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
      "Microsoft.AspNetCore.Server.Kestrel": "1.0.1",
      "Microsoft.AspNetCore.StaticFiles": "1.0.0",
      "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
      "Microsoft.Extensions.Configuration.Json": "1.0.0",
      "Microsoft.Extensions.Configuration.CommandLine": "1.0.0",
      "Microsoft.Extensions.Logging": "1.0.0",
      "Microsoft.Extensions.Logging.Console": "1.0.0",
      "Microsoft.Extensions.Logging.Debug": "1.0.0",
      "Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
  
      "Microsoft.EntityFrameworkCore.Design": {
        "type": "build",
        "version": "1.0.0-preview2-final"
      },
      "Microsoft.EntityFrameworkCore.SqlServer.Design": "1.0.0-rc2-final",
      "Microsoft.EntityFrameworkCore.SqlServer": "1.0.0-rc2-final"
    },
  
    "tools": {
      "Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final",
      "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final",
      "Microsoft.DotNet.Watcher.Tools": "1.0.0-preview2-final",
      "Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final"
    },
  
    "frameworks": {
      "netcoreapp1.0": {
        "imports": [
          "dotnet5.6",
          "portable-net45+win8"
        ]
      }
    },
  
    "buildOptions": {
      "emitEntryPoint": true,
      "preserveCompilationContext": true,
      "compile": {
        "exclude": ["node_modules"]
      }
    }
  </code></pre>
  
  <p>But when I run</p>
  
  <pre><code>dotnet ef dbcontext scaffold "myDbConnectString" Microsoft.EntityFrameworkCore.SqlServer
  </code></pre>
  
  <p>I get the following error and I can not get passed this</p>
  
  <blockquote>
  <pre><code> An error occurred while calling method 'ConfigureDesignTimeServices' on startup class
  </code></pre>
    
    <p>'Microsoft.EntityFrameworkCore.Scaffolding.SqlServerDesignTimeServices'.
    Consider using IDbContextFactory to override the initialization of the
    DbContext at design-time. Error: Could not load type
    'Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions'
    from assembly 'Microsoft.Extensions.DependencyInjection.Abstractions,
    Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.
            System.AggregateException: One or more errors occurred. (Unable to resolve service for type
    'Microsoft.EntityFrameworkCore.Scaffolding.IScaffoldingModelFactory'
    while attempting to activate
    'Microsoft.EntityFrameworkCore.Scaffolding.Internal.ReverseEngineeringGenerator'.)
    ---> System.InvalidOperationException: Unable to resolve service for type
    'Microsoft.EntityFrameworkCore.Scaffolding.IScaffoldingModelFactory'
    while attempting to activate
    'Microsoft.EntityFrameworkCore.Scaffolding.Internal.ReverseEngineeringGenerator'.
               at Microsoft.Extensions.DependencyInjection.ServiceLookup.Service.PopulateCallSites(ServiceProvider
    provider, ISet<code>1 callSiteChain, ParameterInfo[] parameters, Boolean
    throwIfCallSiteNotFound)
               at Microsoft.Extensions.DependencyInjection.ServiceLookup.Service.CreateCallSite(ServiceProvider
    provider, ISet</code>1 callSiteChain)
               at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetResolveCallSite(IService
    service, ISet<code>1 callSiteChain)
               at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetServiceCallSite(Type
    serviceType, ISet</code>1 callSiteChain)
               at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(Type
    serviceType, ServiceProvider serviceProvider)
               at System.Collections.Concurrent.ConcurrentDictionaryExtensions.GetOrAdd[TKey,TValue,TArg](ConcurrentDictionary<code>2
    dictionary, TKey key, Func</code>3 valueFactory, TArg arg)
               at Microsoft.Extensions.DependencyInjection.ServiceProvider.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.Design.DatabaseOperations.ReverseEngineerAsync(String
    provider, String connectionString, String outputDir, String
    dbContextClassName, IEnumerable<code>1 schemas, IEnumerable</code>1 tables,
    Boolean useDataAnnotations, Boolean overwriteFiles, CancellationToken
    cancellationToken)
               at Microsoft.EntityFrameworkCore.Design.Internal.OperationExecutor.ReverseEngineerAsync(String
    provider, String connectionString, String outputDir, String
    dbContextClassName, IEnumerable<code>1 schemaFilters, IEnumerable</code>1
    tableFilters, Boolean useDataAnnotations, Boolean overwriteFiles,
    CancellationToken cancellationToken)
               at Microsoft.EntityFrameworkCore.Tools.Cli.DbContextScaffoldCommand.d__1.MoveNext()
               --- End of inner exception stack trace ---
               at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
               at System.Threading.Tasks.Task<code>1.GetResultCore(Boolean waitCompletionNotification)
               at Microsoft.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[]
    args)
               at Microsoft.EntityFrameworkCore.Tools.Cli.Program.Main(String[] args)
            ---&gt; (Inner Exception #0) System.InvalidOperationException: Unable to resolve service for type
    'Microsoft.EntityFrameworkCore.Scaffolding.IScaffoldingModelFactory'
    while attempting to activate
    'Microsoft.EntityFrameworkCore.Scaffolding.Internal.ReverseEngineeringGenerator'.
               at Microsoft.Extensions.DependencyInjection.ServiceLookup.Service.PopulateCallSites(ServiceProvider
    provider, ISet</code>1 callSiteChain, ParameterInfo[] parameters, Boolean
    throwIfCallSiteNotFound)
               at Microsoft.Extensions.DependencyInjection.ServiceLookup.Service.CreateCallSite(ServiceProvider
    provider, ISet<code>1 callSiteChain)
               at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetResolveCallSite(IService
    service, ISet</code>1 callSiteChain)
               at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetServiceCallSite(Type
    serviceType, ISet<code>1 callSiteChain)
               at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(Type
    serviceType, ServiceProvider serviceProvider)
               at System.Collections.Concurrent.ConcurrentDictionaryExtensions.GetOrAdd[TKey,TValue,TArg](ConcurrentDictionary</code>2
    dictionary, TKey key, Func<code>3 valueFactory, TArg arg)
               at Microsoft.Extensions.DependencyInjection.ServiceProvider.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.Design.DatabaseOperations.ReverseEngineerAsync(String
    provider, String connectionString, String outputDir, String
    dbContextClassName, IEnumerable</code>1 schemas, IEnumerable<code>1 tables,
    Boolean useDataAnnotations, Boolean overwriteFiles, CancellationToken
    cancellationToken)
               at Microsoft.EntityFrameworkCore.Design.Internal.OperationExecutor.ReverseEngineerAsync(String
    provider, String connectionString, String outputDir, String
    dbContextClassName, IEnumerable</code>1 schemaFilters, IEnumerable`1
    tableFilters, Boolean useDataAnnotations, Boolean overwriteFiles,
    CancellationToken cancellationToken)
               at Microsoft.EntityFrameworkCore.Tools.Cli.DbContextScaffoldCommand.d__1.MoveNext()&lt;---
            One or more errors occurred. (Unable to resolve service for type
    'Microsoft.EntityFrameworkCore.Scaffolding.IScaffoldingModelFactory'
    while attempting to activate
    'Microsoft.EntityFrameworkCore.Scaffolding.Internal.ReverseEngineeringGenerator'.)</p>
  </blockquote>
  
  <p>I have tried to change versions of my dependencies back and forth but with no result. Anyone got any pointers?</p>