The type initializer for 'ExtentPlaceholderCreator' threw an exception. RRS feed

  • Question

  • I'm getting the following error on an old LS2011 Silverlight application. It only occurs when I try to save data.  I did try to upgrade from Sql Server 2008 R2 to Sql server 2012 but it failed. I'm not sure what to do at this point. Any help would be appreciated.

    The type initializer for 'ExtentPlaceholderCreator' threw an exception.

       at Microsoft.LightSwitch.Framework.Base.ExecutableObject.Execute(Boolean allowJoin)
       at Microsoft.LightSwitch.Framework.Base.ExecutableObject.Execute()
       at Microsoft.LightSwitch.Details.Framework.Base.MethodInvocation`2.Execute()
       at Microsoft.LightSwitch.Framework.Base.DataService`2.SaveChanges()
       at LightSwitchApplication.StudentMaintenance.StudentMaintenance_Saving(Boolean& handled)
       at LightSwitchApplication.StudentMaintenance.DetailsClass.__StudentMaintenance_InvokeSavingEvent(StudentMaintenance s)
       at Microsoft.LightSwitch.Details.Framework.Client.ScreenDetails`2.<>c__DisplayClass5c.<SaveImpl>b__53()
       at Microsoft.LightSwitch.Utilities.Internal.UserCodeHelper.CallUserCode(Type sourceType, String methodName, String instance, String operation, ILoggingContext context, Action action, String additionalText, Func`1 getCompletedMessage, Boolean tryHandleException, Boolean swallowException, Exception& exception)

    Saturday, October 8, 2016 6:57 PM

All replies

  • Hi Dave,

    From your description above, I'm not sure why this happens, you could try refresh or update a data source,and check whether it makes any difference.

    1. Go to Solution Explorer and right-click on your data source. 
    2. An "Attach Data source Wizard" window will be shown. Select the project you want to import and click on "Finish".

    hope it helps.



    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, October 12, 2016 2:07 AM
  • I made a new solution with the same data base and got the same error. I think the problem is that when I installed sql server 2012 it corrupted something.


    Wednesday, October 12, 2016 3:23 PM
  • Hi Dave, 

    It seems that this is SQL Server issue. You might consider reinstalling SQL Server, and check whether it can fix it. 



    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, October 24, 2016 8:23 AM
  • Thanks Angie,

    I tried to uninstall and reinstall but no luck. I wonder if there are registry settings that need to be deleted.

    I should probably post on Sql fourms.



    Monday, October 24, 2016 3:08 PM
  • Dave, did you get an answer to this?

    I am getting it on a LightSwitch 2015 project when I publish it locally. The only difference is that I have a new machine.

    Others in my group can run the project fine. The only difference I have seen so far is that I have SQL server: 11.0.6248.0 and they have SQL server: 11.0.5343.0



    Thursday, December 29, 2016 3:32 PM
  • Hi Michael,

    Yes, I'm still having the problem.  It has to do with Geo-Spatial datatype in that version of SQL server, even if you don't use them.

    I've uninstalled and reinstalled different versions of SQL Server but I still have the problem.  Maybe it's a registry problem.

    There is a web.config workaround but I can't find it right now.  For LS2011 I don't think I can modify web.config when it generates it each time. But you may be able to with 2015.

    Please post if you find a solution.



    Thursday, December 29, 2016 5:10 PM
  • Dave, thanks for responding!

    Ok I just made this change in the web.config of my VS2015 and when I publish it appears to fix the problem:

            <assemblyIdentity name="Microsoft.SqlServer.Types" publicKeyToken="89845dcd8080cc91" />
            <bindingRedirect oldVersion="" newVersion="" />





    • Proposed as answer by Xbpass Wednesday, October 4, 2017 11:51 AM
    Thursday, December 29, 2016 5:12 PM
  • Yes, that was it. Unfortunately I can't use it for LS2011.
    Thursday, December 29, 2016 7:20 PM
  • I am wondering if Microsoft has any position on this.  The fix is only a work around for something seemingly corrupted by Microsoft.  This is affecting many of our customers, and for some the work around does not work.  Is there going to be a real fix or a real explanation on what is wrong?

    Friday, August 3, 2018 5:19 PM