Visual Studio Developer Center > Visual Studio Forums > Visual Studio Tools for Office > [OnDeserialized] causes System.Reflection.ReflectionTypeLoadException
Ask a questionAsk a question
 

Question[OnDeserialized] causes System.Reflection.ReflectionTypeLoadException

  • Thursday, November 05, 2009 11:05 PMJason 8659876 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    In VS 2008 SP1, with a Word app-level add-in, if I put [OnDeserialized] on a method, I get the below error when Word starts from F5.
    If I instead implement the IDeserializationCallback, there is no such problem.

    ====================
    Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.


    ************** Exception Text **************
    System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
       at System.Reflection.Module._GetTypesInternal(StackCrawlMark& stackMark)
       at System.Reflection.Assembly.GetTypes()
       at Microsoft.Office.Tools.AddIn.CreateRibbonObjects()
       at Microsoft.Office.Tools.AddIn.GetRibbonObjects()
       at Microsoft.Office.Tools.AddIn.CreateRibbonExtensibilityObject()
       at Microsoft.Office.Tools.AddIn.get_RibbonExtensibility()
       at Microsoft.Office.Tools.AddIn.Initialize()
       at blah.ThisAddIn.Initialize() in ThisAddIn.Designer.cs:line 40
       at Microsoft.VisualStudio.Tools.Office.EntryPointComponentBase.Microsoft.VisualStudio.Tools.Applications.Runtime.IEntryPoint.Initialize(IServiceProvider hostContext)
       at Microsoft.VisualStudio.Tools.Applications.AddInAdapter.ExecutePhase(ExecutionPhases executionPhases)
       at Microsoft.VisualStudio.Tools.Office.Internal.OfficeAddInAdapter.InitializeEntryPointsHelper()Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.


    ************** Exception Text **************
    System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
       at System.Reflection.Module._GetTypesInternal(StackCrawlMark& stackMark)
       at System.Reflection.Assembly.GetTypes()
       at Microsoft.Office.Tools.AddIn.CreateRibbonObjects()
       at Microsoft.Office.Tools.AddIn.GetRibbonObjects()
       at Microsoft.Office.Tools.AddIn.CreateRibbonExtensibilityObject()
       at Microsoft.Office.Tools.AddIn.get_RibbonExtensibility()
       at Microsoft.Office.Tools.AddIn.Initialize()
       at blah.ThisAddIn.Initialize() in ThisAddIn.Designer.cs:line 40
       at Microsoft.VisualStudio.Tools.Office.EntryPointComponentBase.Microsoft.VisualStudio.Tools.Applications.Runtime.IEntryPoint.Initialize(IServiceProvider hostContext)
       at Microsoft.VisualStudio.Tools.Applications.AddInAdapter.ExecutePhase(ExecutionPhases executionPhases)
       at Microsoft.VisualStudio.Tools.Office.Internal.OfficeAddInAdapter.InitializeEntryPointsHelper()

All Replies

  • Friday, November 06, 2009 10:22 AMTim LiMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hello Jason,

    Welcome to MSDN forums!

    I've built a blank solution under Visual Studio 2008 SP1 for Word 2007, and add the same attribute which you mentioned, but the error doens't occurred, so, would you please show us your code structure? It looks like you've got Ribbon Object involved. And have you perform something special?

    Looking forward to your feedback.

    Thanks.
     

    Tim Li

    MSDN Subscriber Support in Forum

    If you have any feedback on our support, please contact msdnmg@microsoft.com


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Monday, November 09, 2009 9:47 AMTim LiMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hello,

     

    I am writing to check the status of the issue on your side. Could you please let me know if the suggestion works for you or not? If you have any questions or concerns, please feel free to let me know. I will be more than happy to be of assistance.

     

    Tim Li

    MSDN Subscriber Support in Forum

    If you have any feedback on our support, please contact msdnmg@microsoft.com


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.