locked
InvalidVariant error in VS2005 RRS feed

  • Question

  • I recently went back to debug something in my VS2005 package after working on the upgrade to 2008.  I have not changed any of the code, but I am now getting this error on the call to AddFromTemplate:

    InvalidVariant was detected
    Message: An invalid VARIANT was detected during a conversion from an unmanaged VARIANT to a managed object.
    Passing invalid VARIANTs to the CLR can cause unexpected exceptions, corruption or data loss.

    I turned off the MDA for invalid variants to bypass this and now I hit my exception handler with this message:

    System.AccessViolationException was caught
      Message="Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
      Source="EnvDTE80"
      StackTrace:
           at EnvDTE80.Solution2.AddFromTemplate(String FileName, String Destination, String ProjectName, Boolean Exclusive)
           at Idea.Xgen.Package.XgenWizard.Microsoft.VisualStudio.TemplateWizard.IWizard.ProjectFinishedGenerating(Project m_project)

    Anyone have any ideas where to start looking? 

    Tuesday, July 6, 2010 7:00 PM

All replies