none
_COMPlusExceptionCode = -532459699

    Question

  • Hello everyone,

    I am writting a visual studio addinto generate xml files. when i am saving the projectitem, i am getting this exception: _COMPlusExceptionCode = -532459699

    If anybody could help.

    Here is the code i have written:

    StreamWriter writer = File.CreateText(newname);

    writer.WriteLine("<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>");

    writer.WriteLine("<Logic>");

    writer.WriteLine(String.Format("\t<Context ID=\"{0}\" query=\"Default\">", blclass.FullName));

    writer.WriteLine("\t</Context>");

    writer.WriteLine("");

    writer.WriteLine("\t<Query ID=\"Default\">");

    writer.WriteLine("\t</Query>");

    writer.WriteLine("");

    writer.WriteLine("</Logic>");

    writer.Close();

    EnvDTE.ProjectItem project = bldocument.ProjectItem.ProjectItems.AddFromFile(newname);

    EnvDTE.Property property = (EnvDTE.Property)project.Properties.Item("BuildAction");

    property.Value = 3;

    project.Save(newname);//this is where they r showing this error

    document = _applicationObject.Documents.Open(newname, "XML", false);

    document.Save(newname);

    Tuesday, June 06, 2006 11:03 AM

Answers

  • Hi,

      I was not able to reproduce your issue. Could you review the macro below and let me know if I was did it incorrectly.

    Public Sub test()
            Dim writer As System.IO.StreamWriter = System.IO.File.CreateText("C:\foo.xml")
            writer.WriteLine("<?xml version='1.0' encoding='utf-8' standalone='yes' ?>")
            writer.WriteLine("<Logic>")
            writer.WriteLine("<Context>")
            writer.WriteLine("\t</Context>")
            writer.WriteLine("")
            writer.WriteLine("\t<Query")
            writer.WriteLine("\t</Query>")
            writer.WriteLine("")
            writer.WriteLine("</Logic>")
            writer.Close()
            Dim pi As ProjectItem = DTE.Solution.Projects.Item(1).ProjectItems.AddFromFile("C:\foo.xml")
            pi.Open()
            pi.Save()

    End Sub

    Thanks

    Dr. eX

    Tuesday, June 06, 2006 5:13 PM

All replies

  • Hi,

      I was not able to reproduce your issue. Could you review the macro below and let me know if I was did it incorrectly.

    Public Sub test()
            Dim writer As System.IO.StreamWriter = System.IO.File.CreateText("C:\foo.xml")
            writer.WriteLine("<?xml version='1.0' encoding='utf-8' standalone='yes' ?>")
            writer.WriteLine("<Logic>")
            writer.WriteLine("<Context>")
            writer.WriteLine("\t</Context>")
            writer.WriteLine("")
            writer.WriteLine("\t<Query")
            writer.WriteLine("\t</Query>")
            writer.WriteLine("")
            writer.WriteLine("</Logic>")
            writer.Close()
            Dim pi As ProjectItem = DTE.Solution.Projects.Item(1).ProjectItems.AddFromFile("C:\foo.xml")
            pi.Open()
            pi.Save()

    End Sub

    Thanks

    Dr. eX

    Tuesday, June 06, 2006 5:13 PM
  • Hi,

    First of all thanks for the reply. I dont see anything different you did in this piece of code. But still i was having problem. The thing is the file is generated, but pi.Open(); generates this exception. I still dont know why.

    Wednesday, June 07, 2006 12:14 PM
  • Hi Ranju_Akram,

    I also have the same problem. But its to do with a .odx file of BizTalk 2006 in Visual Studio 2005. I get the same error of _COMPlusExceptionCode = -532459699 when .Open() is called.

    Please let me know if you got around the problem..

     

    Regards

    Sujit

    Tuesday, December 19, 2006 1:39 PM
  • _COMPlusExceptionCode -532459699 - i got this same error for an InvalidViewState in some of my applciation's pages when I was clicking around to test them.
    Tuesday, July 10, 2007 9:00 PM
  • I actually didn't find any work around and this really doesn't make any sense to me why it could happen... i changed my code some other way....
    would be really nice to know if any body could solve it
    Wednesday, July 11, 2007 3:15 PM
  • Hi there!

     

    Replace the line:

     

    project.Save(newname);

     

    with

     

    project.Save();

     

    I believe that the Save method doesn't take arguments.

     

    Respects.

    Tuesday, October 02, 2007 1:49 PM