Stack error with VS2005

Recently I found an issue with our VB.Net and C# demo for PDF components. When compiling with VS2005, the component will fail to be initialized with a stack overflow error. The one compiled with VS2003 (.Net 1.1), the VB, VBScript demo all works well. So I doubt if this is a bug of .Net 2.0.

Overal it is very strange error. The current workaround I found is to call the PDF methods in a second thread which can work well on both .Net 1.1 and 2.0.

Here is the new demo codes for our PDF Split and Merge component.

  Private Sub DoTest()
        Dim pdf As PDFSplitMerge.CPDFSplitMergeObj

        pdf = New CPDFSplitMergeObj

        pdf.SetCode(“Your license code here”)

        pdf.Split(“..1.pdf”, “1;1;1″, “..sp1-%d.pdf”)
        pdf.Split(“..1.pdf”, “1;2;3;4;1-2,3-4;1″, “..sp%d.pdf”)

        pdf.Merge(“..sp0.pdf|..sp1.pdf”, “..m1.pdf”)
        pdf.Merge(“..1.pdf?1-2|..sp1.pdf”, “..m2.pdf”)
        pdf.Merge(“..1.pdf?1-2|..sp1.pdf?2″, “..m1.pdf”)

        pdf = Nothing
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim job As Thread

        job = New Thread(New ThreadStart(AddressOf DoTest))
        job.Start()
        job.Join()
    End Sub

I will keep it updated if we find more deep reason for this issue.