Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
170
System.IO.DirectoryNotFoundException: 0x80070003 from UltraDockManager.LoadFromXML
posted

Hi

I'm having a problem deploying an application I have written which uses the UltraDockManager.LoadFromXML command to restore the document layout previously saved to SQL server 2000.  The procedure works fine on my development machine but the compiled version errors when deployed on the server, with: System.IO.DirectoryNotFoundException: The system cannot find the path specified. (Exception from HRESULT: 0x80070003) when it tries to execute the line: objUltraDockManager.LoadFromXML(objFileStream).objUltraDockManager is the control on the form.  objFileStream is a system.io.memorystream object. Because I’m loading from a file memory stream, I have no idea why the objUltraDockManager would be looking for a path or what path it is looking for. Additionally, this code works perfectly on my development machine both in debug and compiled.  It loads the form layout from the database as intended. I am using Infragistics2.Win.UltraWinDock.v8.2.dll from the NetAdvantage collection. 

Do I need to do something extra for the ultradockmanger, when compiling for release? 

Why does this object need a path when it is using a stream?

Is it a temp path, if so what path is it, and how do I configure it?

Any help greatly appreciated.PenPal1999.

 

Process Trace:
 0)  modMain.LoadFormLayout
 1)  frmMainMDI.frmMainMDI_Load
System.IO.DirectoryNotFoundException: The system cannot find the path specified. (Exception from HRESULT: 0x80070003)
   at NoticeManagement_Module.modMain.LoadFormLayout(String strNetworkLoginName, String strProgramName, String strUltraFormName, UltraDockManager& objUltraDockManager) in C:\Documents and Settings\<development machines file path?>\modMain.vb:line 1263
   at NoticeManagement_Module.frmMainMDI.frmMainMDI_Load(Object sender, EventArgs e) in C:\Documents and Settings\<development machines file path?>\frmMainMDI.vb:line 255

 

      Public Function LoadFormLayout(ByVal strNetworkLoginName As String _
                                 , ByVal strProgramName As String _
                                 , ByVal strUltraFormName As String _
                                 , ByRef objUltraDockManager As Infragistics.Win.UltraWinDock.UltraDockManager) As String
        '================================================================================'
        '= Function Name: LoadFormLayout()                                               '
        '= Creation Date: 14 January 2009                                                '
        '= Author:  <PenPal1999>                                                         '
        '= Description: Loads Dock layout from SQL Server 2000                           '
        '=                                                                               '
        '================================================================================'
        Dim strReturn As String = ""
        Dim objFileStream As System.IO.MemoryStream = Nothing
        Dim objStreamReader As System.IO.StreamReader = Nothing
        Dim strXMLFile As String = ""
       

        Dim objFormLayout As _VB2008_MidasUniversalADO.clsNMM_UltraDockManLayout_Item = Nothing

        Try
            objFormLayout = objMUFC.GetUltraDockManLayout(strNetworkLoginName _
                                                        , strProgramName _
                                                        , strUltraFormName)
            If objFormLayout Is Nothing Then
                strReturn = "Form layout not found. Default layout will be used."
            Else
                With objFormLayout
                    If .XMLLayout.Length > 0 Then
                        objFileStream = objStringToStream(.XMLLayout)
                        If objFileStream Is Nothing Then
                            strReturn = "Failed to load form layout."
                        Else
                            If objFileStream.CanRead And objFileStream.CanSeek Then
                                objFileStream.Seek(0, IO.SeekOrigin.Begin)

                                objUltraDockManager.LoadFromXML(objFileStream)   '<<< This line throws the error on the server.

                                strReturn = "Form layout has been loaded successfully."
                            Else
                                strReturn = "Error loading stream. Stream error."
                            End If
 

                        End If
                    End If
                End With
            End If
        Catch MyError As System.Exception
            Throw MyError
        Finally
        End Try
        Return strReturn
    End Function

 

         Public Function objStringToStream(ByVal strStringToConvert As String) As System.IO.MemoryStream
            '================================================================================'
            '= Function Name: objStringToStream()                                            '
            '= Creation Date: 14 January 2009                                                '
            '= Author:        <PenPal1999>'
            '= Description:                                                                  '
            '=                                                                               '
            '================================================================================'
            Dim objReturn As System.IO.MemoryStream = Nothing
            Dim objASCIIEncoding As ASCIIEncoding = Nothing
            Dim arrByteData() As Byte = Nothing
   
   
            Try
                objASCIIEncoding = New ASCIIEncoding
                arrByteData = objASCIIEncoding.GetBytes(strStringToConvert)
   
                objReturn = New System.IO.MemoryStream
                objReturn.Write(arrByteData, 0, arrByteData.Length)
   
            Catch MyError As System.Exception
                Throw MyError
            Finally
            End Try
            Return objReturn
        End Function
Parents
No Data
Reply
  • 170
    Verified Answer
    posted

    Hi

    I've solved the problem now. It was simply a bad copy of the dot net framework on the server. I created an installation package for my application and when I tried to install it on the server, it requested that I installed framework 3.5 (which was already on the server, so somthing must have been wrong with it). When the application finally installed the layout works as it should.

    I'll try and blog my load and save routines soon.

    Regards

    PenPal1999

Children
No Data