Build/Test Issues

The type initializer for 'ExtentPlaceholderCreator' threw an exception

Started by Albatross on 8,280 views

I have been using NCrunch for some time, but this morning all of my tests that access my local database are failing.

The error is:

OneTimeSetUp: 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'.

This happens whenever SaveChanges is called on the local database.

Having googled the problem it appears that it could be something to do with an update to a Microsoft Package, but nothing has been updated recently on my computer.

Any help or pointers would be appreciated.
Hi, thanks for sharing this problem.

Do you also receive this error when running your tests using anything other than NCrunch?
The same error is shown when running with NUnit.

I have tried uninstalling the SQL Server 2012 updates that were installed on Monday, but that has not fixed the problem.

My guess is that an update has caused the issue as there have been no code changes since it was last running, but how do I resolve the issue?

Edited

Albatross wrote:The same error is shown when running with NUnit.

I have tried uninstalling the SQL Server 2012 updates that were installed on Monday, but that has not fixed the problem.

My guess is that an update has caused the issue as there have been no code changes since it was last running, but how do I resolve the issue?


Sorry, I honestly have no idea about this one.

As the problem is being surfaced also outside NCrunch (in NUnit), it isn't being caused by anything inside the NCrunch runner.

I recommend googling the issue to see if others have encountered it. Maybe something is going wrong inside the platform.
To resolve the issue I have changed the app.config file used in the test project as follows:

from:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.SqlServer.Types" publicKeyToken="89845dcd8080cc91" />
        <bindingRedirect oldVersion="1.0.0.0-13.0.0.0" newVersion="10.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>


to:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.SqlServer.Types" publicKeyToken="89845dcd8080cc91" />
        <bindingRedirect oldVersion="1.0.0.0-13.0.0.0" newVersion="10.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

Post a reply

Log in to reply.