efcore
efcore copied to clipboard
[MusicStore]: EF fails with an exception on net45
@ajcvickers @rowanmiller - Moving the bug to the product repo. Closing the corresponding bug (https://github.com/aspnet/MusicStore/issues/56) in MusicStore repo.
EF fails with an exception on net45.
:(
Helios failed to start.
The ApplicationStart method threw an exception. Detailed exception information is below.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeLoadException: Method 'get_Name' in type 'Microsoft.Data.SqlServer.SqlServerDataStoreSource' from assembly 'Microsoft.Data.SqlServer, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.
at Microsoft.Data.Entity.SqlServerEntityServicesBuilderExtensions.AddSqlServer(EntityServicesBuilder builder)
at Startup.<Configuration>b__3(EntityServicesBuilder s) in D:\K\src\MusicStore\src\MusicStore\Startup.cs:line 44
at Microsoft.AspNet.DependencyInjection.EntityServiceCollectionExtensions.AddEntityFramework(ServiceCollection serviceCollection, Action`1 nestedBuilder)
at Startup.<>c__DisplayClass0.<Configuration>b__2(ServiceCollection services) in D:\K\src\MusicStore\src\MusicStore\Startup.cs:line 44
at Microsoft.AspNet.ContainerExtensions.UseServices(IBuilder builder, Action`1 configureServices)
at Startup.Configuration(IBuilder app) in D:\K\src\MusicStore\src\MusicStore\Startup.cs:line 32
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at Microsoft.AspNet.Hosting.Startup.StartupLoader.<>c__DisplayClass0.<LoadStartup>b__3(IBuilder builder)
at Microsoft.AspNet.Loader.IIS.KlrHttpApplication.HeliosStartupLoaderProvider.WrappingStartupLoader.<>c__DisplayClass0.<LoadStartup>b__2(IBuilder builder)
at Microsoft.AspNet.Hosting.HostingEngine.EnsureApplicationDelegate(HostingContext context)
at Microsoft.AspNet.Hosting.HostingEngine.Start(HostingContext context)
at Microsoft.AspNet.Loader.IIS.KlrHttpApplication.ApplicationStart(IHttpApplication application)
at Microsoft.AspNet.Loader.IIS.HttpApplicationBase.InvokeApplicationStart(IHttpApplication application)
I'm not able to reproduce this. Just looked at a repro with @Praburaj and it had mismatched versions of SqlServer and the other Microsoft.Data.* packages. This all works with the latest ones (confirmed on @Praburaj machine too).