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

Error when running Unit Tests #18

Open
lawrenceshort opened this issue Apr 8, 2016 · 1 comment
Open

Error when running Unit Tests #18

lawrenceshort opened this issue Apr 8, 2016 · 1 comment

Comments

@lawrenceshort
Copy link

When Running the tests I get a rather annoying error.

System.TypeInitializationException : The type initializer for 'ExtentPlaceholderCreator' threw an exception.
----> System.Reflection.TargetInvocationException : Exception has been thrown by the target of an invocation.
----> System.EntryPointNotFoundException : Unable to find an entry point named 'SetClrFeatureSwitchMap' in DLL 'SqlServerSpatial110.dll'.
at System.Data.Mapping.Update.Internal.Propagator.ExtentPlaceholderCreator.GetPropagatorResultForPrimitiveType(PrimitiveType primitiveType, ref PropagatorResult result)
at System.Data.Mapping.Update.Internal.Propagator.ExtentPlaceholderCreator.Visit(EdmMember node)
at System.Data.Mapping.Update.Internal.Propagator.ExtentPlaceholderCreator.CreateEntitySetPlaceholder(EntitySet entitySet)
at System.Data.Mapping.Update.Internal.Propagator.Visit(DbScanExpression node)
at System.Data.Mapping.Update.Internal.Propagator.Visit(DbProjectExpression node)
at System.Data.Mapping.Update.Internal.Propagator.Visit(DbJoinExpression node)
at System.Data.Mapping.Update.Internal.Propagator.Visit(DbProjectExpression node)
at System.Data.Mapping.Update.Internal.UpdateTranslator.d__44.MoveNext()
at System.Linq.Enumerable.d__581.MoveNext() at System.Data.Mapping.Update.Internal.UpdateCommandOrderer..ctor(IEnumerable1 commands, UpdateTranslator translator)
at System.Data.Mapping.Update.Internal.UpdateTranslator.ProduceCommands()
at System.Data.Mapping.Update.Internal.UpdateTranslator.Update(IEntityStateManager stateManager, IEntityAdapter adapter)
at System.Data.Objects.ObjectContext.SaveChanges(SaveOptions options)
at System.Data.Entity.Internal.InternalContext.SaveChanges()
at ReliableDbProvider.Tests.DbProviderTestBase`1.Insert_and_select_multiple_entities() in DbProviderTestBase.cs: line 72
--TargetInvocationException
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.Data.SqlClient.SqlSpatialServices.GeometryFromText(String geometryText)
at System.Data.Mapping.Update.Internal.Propagator.ExtentPlaceholderCreator.InitializeTypeDefaultMap()
at System.Data.Mapping.Update.Internal.Propagator.ExtentPlaceholderCreator..cctor()
--EntryPointNotFoundException
at Microsoft.SqlServer.Types.GLNativeMethods.SetClrFeatureSwitchMap(Int32 clrFeatureSwitchMap)
at Microsoft.SqlServer.Types.SqlGeometry.IsValidExpensive()
at Microsoft.SqlServer.Types.SqlGeometry.Construct(GeoData g, Int32 srid)
at Microsoft.SqlServer.Types.SqlGeometry.GeometryFromText(OpenGisType type, SqlChars text, Int32 srid)
at Microsoft.SqlServer.Types.SqlGeometry.Parse(SqlString s)

I've managed to sort it by redirecting the Micosoft.SqlServer.Types assembly to version 12.0 or version 10.0 but it does feel like a hack.

  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.SqlServer.Types" publicKeyToken="89845dcd8080cc91" />
        <bindingRedirect oldVersion="1.0.0.0-11.0.0.0" newVersion="12.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>

Unfortuantely I don't think it's a problem with the project it's an installation of types of sql server issue.

@robdmoore
Copy link
Member

Interesting. I wonder if that's a problem with the setup on your computer or we need to add that into the config file of the project?

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

2 participants