Skip to content
This repository has been archived by the owner on Dec 18, 2017. It is now read-only.

EF.SqlServer again regressed on mono #690

Closed
Praburaj opened this issue Oct 3, 2014 · 8 comments
Closed

EF.SqlServer again regressed on mono #690

Praburaj opened this issue Oct 3, 2014 · 8 comments
Assignees
Milestone

Comments

@Praburaj
Copy link
Contributor

Praburaj commented Oct 3, 2014

Issue similar or same as this : #374

Looks like with beta bits, EF Sql server package is running into this issue again. Reopening the bug @suhasj

We used KRE# beta1-10491 and tested against both 3.6.1 and 3.8.0 of mono.

@davidfowl
Copy link
Member

What's the issue. Can you be more specific?

@Praburaj
Copy link
Contributor Author

Praburaj commented Oct 3, 2014

@suhasj - could you copy paste the compilation errors?

@bricelam
Copy link
Contributor

bricelam commented Oct 3, 2014

I'm not sure this can work. We need the .NET 4.5.1 contract of System.Data.dll, but Mono only implements .NET 4.5.

@suhasj
Copy link
Contributor

suhasj commented Oct 3, 2014

I don't have my Mac machine right now but the error is that the project is unable to reference EntityFramework.SqlServer package. @Praburaj mentioned that this was fixed since I am able run MusicStore using alpha4 bits of KRE and EF packages

@Praburaj
Copy link
Contributor Author

Praburaj commented Oct 3, 2014

Musicstore uses Inmemory store when executed on mac. But the sample includes EntityFramework.SqlServer & InMemoryStore in project.json so that the sample executes on both windows and non windows machines. The types & extensions from the SqlServer package used to resolve (not necessary executed) on mono after #374 was fixed.

With latest KRE and framework packages the build is broken on mono with failure to resolve types in the sql server package. Easiest repro is get the music store code and build & run on mono.

@suhasj
Copy link
Contributor

suhasj commented Oct 3, 2014

Full stacktrace for FYI

Microsoft.Framework.Runtime.Roslyn.RoslynCompilationException: /Users/ktest/Documents/MusicStore/src/MusicStore/Models/SampleData.cs(8,29): error CS0234: The type or namespace name 'SqlServer' does not exist in the namespace 'Microsoft.Data.Entity' (are you missing an assembly reference?)
/Users/ktest/Documents/MusicStore/src/MusicStore/Startup.cs(46,30): error CS0411: The type arguments for method 'IdentityEntityFrameworkServiceCollectionExtensions.AddSqlServer<TContext, TUser, TRole>(IServiceCollection)' cannot be inferred from the usage. Try specifying the type arguments explicitly.
/Users/ktest/Documents/MusicStore/src/MusicStore/Mocks/StartupSocialTesting.cs(59,30): error CS0411: The type arguments for method 'IdentityEntityFrameworkServiceCollectionExtensions.AddSqlServer<TContext, TUser, TRole>(IServiceCollection)' cannot be inferred from the usage. Try specifying the type arguments explicitly.
/Users/ktest/Documents/MusicStore/src/MusicStore/Models/SampleData.cs(22,72): error CS0246: The type or namespace name 'SqlServerDataStore' could not be found (are you missing a using directive or an assembly reference?)
  at Microsoft.Framework.Runtime.Roslyn.RoslynProjectReference.Load (IAssemblyLoaderEngine loaderEngine) [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.Runtime.Loader.ProjectAssemblyLoader.Load (System.String name) [0x00000] in <filename unknown>:0 
  at klr.host.LoaderContainer.Load (System.String name) [0x00000] in <filename unknown>:0 
  at klr.hosting.RuntimeBootstrapper+<>c__DisplayClasse.<ExecuteAsync>b__4 (System.Reflection.AssemblyName assemblyName) [0x00000] in <filename unknown>:0 
  at klr.hosting.RuntimeBootstrapper+<>c__DisplayClasse.<ExecuteAsync>b__7 (System.Object sender, System.ResolveEventArgs a) [0x00000] in <filename unknown>:0 
  at System.AppDomain.DoAssemblyResolve (System.String name, Boolean refonly) [0x00000] in <filename unknown>:0 
  at (wrapper managed-to-native) System.AppDomain:LoadAssembly (System.AppDomain,string,System.Security.Policy.Evidence,bool)
  at System.AppDomain.Load (System.Reflection.AssemblyName assemblyRef, System.Security.Policy.Evidence assemblySecurity) [0x00000] in <filename unknown>:0 
  at (wrapper remoting-invoke-with-check) System.AppDomain:Load (System.Reflection.AssemblyName,System.Security.Policy.Evidence)
  at System.AppDomain.Load (System.Reflection.AssemblyName assemblyRef) [0x00000] in <filename unknown>:0 
  at (wrapper remoting-invoke-with-check) System.AppDomain:Load (System.Reflection.AssemblyName)
  at System.Reflection.Assembly.Load (System.Reflection.AssemblyName assemblyRef) [0x00000] in <filename unknown>:0 
  at Microsoft.AspNet.Hosting.Startup.StartupLoader.LoadStartup (System.String applicationName, System.String environmentName, IList`1 diagnosticMessages) [0x00000] in <filename unknown>:0 
  at Microsoft.AspNet.Hosting.Startup.StartupManager.LoadStartup (System.String applicationName, System.String environmentName) [0x00000] in <filename unknown>:0 
  at Microsoft.AspNet.Hosting.HostingEngine.EnsureApplicationStartup (Microsoft.AspNet.Hosting.HostingContext context) [0x00000] in <filename unknown>:0 
  at Microsoft.AspNet.Hosting.HostingEngine.EnsureApplicationDelegate (Microsoft.AspNet.Hosting.HostingContext context) [0x00000] in <filename unknown>:0 
  at Microsoft.AspNet.Hosting.HostingEngine.Start (Microsoft.AspNet.Hosting.HostingContext context) [0x00000] in <filename unknown>:0 
  at Microsoft.AspNet.Hosting.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0 
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 

@davidfowl davidfowl added this to the 1.0.0-beta1 milestone Oct 5, 2014
@davidfowl davidfowl self-assigned this Oct 5, 2014
@davidfowl
Copy link
Member

Issue is understood. It's related to the frameworkAssemblies changes. I'm going to work on fixing up that logic and will need to update all the repositories as a result.

The logic put in to keep backwards compatibility while we update the project.json file is causing this problem for mono and EF. It's using the EntityFramework.SqlServer from mono's gac instead of the package.

@davidfowl
Copy link
Member

Fixed in cb70ea7

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

No branches or pull requests

4 participants