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

System.ValueTuple not found at runtime #1

Open
julielerman opened this issue Jun 28, 2017 · 3 comments
Open

System.ValueTuple not found at runtime #1

julielerman opened this issue Jun 28, 2017 · 3 comments

Comments

@julielerman
Copy link
Owner

This is a simple version to demonstrate this problem though I've been having it with other solutions where I'm trying to run MSTest against EF Core nightly. I've tried many different versions of dependent packages.

.NET Core latest sdk/runtime are installed.

I will try THIS solution on a clean VM.
`Here is the error and stack for this single test:
Test Name: CanRunQuery
Test FullName: UnitTestProject.UnitTest1.CanRunQuery
Test Source: C:\Users\Julie\Documents\Visual Studio 2017\Projects\EFCOrePreview2\UnitTestProject\UnitTest1.cs : line 13
Test Outcome: Failed
Test Duration: 0:00:00.4347583

Result StackTrace:
at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.SharedTableConvention.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.Metadata.Internal.InternalModelBuilder.Validate()
at Microsoft.EntityFrameworkCore.Infrastructure.ModelSource.CreateModel(DbContext context, IConventionSetBuilder conventionSetBuilder, IModelValidator validator)
at Microsoft.EntityFrameworkCore.Infrastructure.ModelSource.<>c__DisplayClass5_0.b__0(Object k)
at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory)
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.b__7_1(IServiceProvider p)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(IServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProvider provider) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(IServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(IServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProvider provider) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(IServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.<>c__DisplayClass22_0.b__0(ServiceProvider provider)
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.DbContext.get_DbContextDependencies()
at Microsoft.EntityFrameworkCore.DbContext.get_Model()
at Microsoft.EntityFrameworkCore.Internal.InternalDbSet1.get_EntityType() at Microsoft.EntityFrameworkCore.Internal.InternalDbSet1.get_EntityQueryable()
at Microsoft.EntityFrameworkCore.Internal.InternalDbSet1.System.Collections.Generic.IEnumerable<TEntity>.GetEnumerator() at System.Collections.Generic.List1..ctor(IEnumerable1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source)
at UnitTestProject.UnitTest1.CanRunQuery() in C:\Users\Julie\Documents\Visual Studio 2017\Projects\EFCOrePreview2\UnitTestProject\UnitTest1.cs:line 17
Result Message:
Test method UnitTestProject.UnitTest1.CanRunQuery threw exception:
System.IO.FileLoadException: Could not load file or assembly 'System.ValueTuple, Version=0.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
`

@jcouv
Copy link

jcouv commented Jun 30, 2017

Two things I would try:

  • assuming the test is getting run on a desktop runtime (not Core runtime), the most direct way of troubleshooting failures to load assemblies is to use "fusion log viewer" (fuslogvw). Open it, set it to log binding failures to a custom path on disk, clear its log, then repro, then refresh. You should see a couple of entries, and hopefully one is related to ValueTuple. Then click on that entry and share the log.
  • another simple thing I would check is what assemblies are in the output (bin) folder, assuming that the tests run from there.

@julielerman
Copy link
Owner Author

The creator of the SqlCE provider has run into this problem now confirming that it is not something I've done wrong. He does not have the option to use netcore for his test project therefore it is a hugely blocking problem for him. He is going to pursue it first in his repo (ErikEJ/EntityFramework.SqlServerCompact#463 ) and then follow up by raising an issue either with EF or where he finds it relevant.

@ErikEJ
Copy link

ErikEJ commented Jul 3, 2017

I already have a long discussion/troubleshooting session here: dotnet/efcore#9046

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

3 participants