I'm attempting to use XMLBasics to store some startup options and am having trouble getting it to work. I keep getting an error whenever I try to open it encrypted when it has no data in it yet. A couple of things are confusing the heck out of me. First, when I look at the source code (that I have), there is no OpenXMLFileBase method in XMLBasics. I'm thinking y'all have changed this one lately. Second, it appears to be loosing the a temp file (the file listed as not being found is not the file I'm opening) during the encryption process. If I turn off encryption, it works fine.
Here's the code and the exception:
Here is the function:
Private Function GetDataSet() As DataSet
'-- Establish a return variable
Dim retSet As DataSet
'-- Build the full path to the file
Dim fullPath As String = Path.Combine(Me.GetPath(), Me.XmlFileName)
'-- Open the file and get the data set
retSet = XmlBasics.OpenXmlFile(Me.GetCurrentVersion() _
, Me.TableName _
, fullPath _
, Me.GetXmlStructure() _
, True)
'--return the store data table
Return retSet
End Function
And the exception:
FileNotFoundException
Could not find file 'C:\Documents and Settings\greg\Local Settings\Temp\glu221xf.tmp'.
Source : mscorlib
Stack Trace:
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials)
at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn)
at System.Xml.XmlTextReaderImpl.OpenUrlDelegate(Object xmlResolver)
at System.Threading.CompressedStack.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.CompressedStack.Run(CompressedStack compressedStack, ContextCallback callback, Object state)
at System.Xml.XmlTextReaderImpl.OpenUrl()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlTextReader.Read()
at System.Xml.XmlReader.MoveToContent()
at System.Data.DataSet.ReadXml(XmlReader reader, XmlReadMode mode, Boolean denyResolving)
at System.Data.DataSet.ReadXml(String fileName, XmlReadMode mode)
at MicroFour.StrataFrame.Xml.XmlBasics.OpenXMLFileBase(String CurrentVersion, String TableName, String PathAndFileName, List`1 ColumnStructure)
at MicroFour.StrataFrame.Xml.XmlBasics.OpenXmlFile(String Version, String TableName, String PathAndFileName, List`1 ColumnStructure, Boolean DecryptFile)
at ConnestionStringFileManager.ConnectionStrings.OpenStore() in E:\SacredSpaceSoftware\ConnestionStringFileManager\ConnectionStrings.vb:line 296
at ConnestionStringFileManager.ConnectionStrings.GetData() in E:\SacredSpaceSoftware\ConnestionStringFileManager\ConnectionStrings.vb:line 323
at ConnestionStringFileManager.ConnectionStrings.LoadStore() in E:\SacredSpaceSoftware\ConnestionStringFileManager\ConnectionStrings.vb:line 250
at ConnestionStringFileManager.ConnectionStrings.Load() in E:\SacredSpaceSoftware\ConnestionStringFileManager\ConnectionStrings.vb:line 139
at ConnestionStringFileManager.MainForm.cmdLoad_Click(Object sender, EventArgs e) in E:\SacredSpaceSoftware\ConnestionStringFileManager\MainForm.vb:line 46
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativewindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativewindow.WndProc(Message& m)
at System.Windows.Forms.Nativewindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)