The following code works when I debug and when I install the software
and run the .exe, but if I try to open the form in the designer (which
causes this code to run), I get an error:
Private Sub LoadTestSetting s()
Dim rootPath As String
Dim eventHandler As ValidationEvent Handler
rootPath = My.Application. Info.DirectoryP ath
eventHandler = New ValidationEvent Handler(Address Of
XmlValidationEv entHandler)
_xmlDocument = New XmlDocument()
_xmlDocument.Lo ad(rootPath & "\" & "TestSettings.x ml") '-->this is
where the error occurs<--
_xmlDocument.Sc hemas.Add("http ://tempuri.org/TestXmlSchema.x sd",
rootPath & "\" & "TestXmlSchema. xsd")
_xmlDocument.Va lidate(eventHan dler)
End Sub
If I try to open the form in the designer, I get this error:
Could not find file 'C:\Documents and Settings\DanThM an\Local Settings
\Application Data\Microsoft\ VisualStudio\8. 0\ProjectAssemb lies
\gyyihrso01\Tes tSettings.xml'.
at System.IO.__Err or.WinIOError(I nt32 errorCode, String maybeFullPath)
at System.IO.FileS tream.Init(Stri ng path, FileMode mode, FileAccess
access, Int32 rights, Boolean useRights, FileShare share, Int32
bufferSize, FileOptions options, SECURITY_ATTRIB UTES secAttrs, String
msgPath, Boolean bFromProxy)
at System.IO.FileS tream..ctor(Str ing path, FileMode mode, FileAccess
access, FileShare share, Int32 bufferSize)
at System.Xml.XmlD ownloadManager. GetStream(Uri uri, ICredentials
credentials)
at System.Xml.XmlU rlResolver.GetE ntity(Uri absoluteUri, String role,
Type ofObjectToRetur n)
at System.Xml.XmlT extReaderImpl.O penUrlDelegate( Object xmlResolver)
at System.Threadin g.CompressedSta ck.runTryCode(O bject userData)
at
System.Runtime. CompilerService s.RuntimeHelper s.ExecuteCodeWi thGuaranteedCle anup(TryCode
code, CleanupCode backoutCode, Object userData)
at System.Threadin g.CompressedSta ck.Run(Compress edStack
compressedStack , ContextCallback callback, Object state)
at System.Xml.XmlT extReaderImpl.O penUrl()
at System.Xml.XmlT extReaderImpl.R ead()
at System.Xml.XmlL oader.Load(XmlD ocument doc, XmlReader reader,
Boolean preserveWhitesp ace)
at System.Xml.XmlD ocument.Load(Xm lReader reader)
at System.Xml.XmlD ocument.Load(St ring filename)
at Test.DataManage r.LoadTestSetti ngs() in C:\Documents and Settings
\DanThMan\My Documents\Proje cts\Test\Develo pment\App Code\Test\Test
\DataManager.vb :line 46
at Test.DataManage r..ctor() in C:\Documents and Settings\DanThM an\My
Documents\Proje cts\Test\Develo pment\App Code\Test\Test
\DataManager.vb :line 33
at Test.DataManage r..cctor() in C:\Documents and Settings\DanThM an\My
Documents\Proje cts\Test\Develo pment\App Code\Test\Test
\DataManager.vb :line 20
I can't figure out what to specify for the filename in
XmlDocument.Loa d(string fileName). Does
My.Application. Info.DirectoryP ath not work if not in debug mode? If
not, what should I do to get the designer to open?
Thanks for your help,
-Dan 4 1702
change rootpath to application.sta rtuppath
"DanThMan" <da******@cox.n etwrote in message
news:11******** **************@ p10g2000cwp.goo glegroups.com.. .
The following code works when I debug and when I install the software
and run the .exe, but if I try to open the form in the designer (which
causes this code to run), I get an error:
Private Sub LoadTestSetting s()
Dim rootPath As String
Dim eventHandler As ValidationEvent Handler
rootPath = My.Application. Info.DirectoryP ath
eventHandler = New ValidationEvent Handler(Address Of
XmlValidationEv entHandler)
_xmlDocument = New XmlDocument()
_xmlDocument.Lo ad(rootPath & "\" & "TestSettings.x ml") '-->this is
where the error occurs<--
_xmlDocument.Sc hemas.Add("http ://tempuri.org/TestXmlSchema.x sd",
rootPath & "\" & "TestXmlSchema. xsd")
_xmlDocument.Va lidate(eventHan dler)
End Sub
If I try to open the form in the designer, I get this error:
Could not find file 'C:\Documents and Settings\DanThM an\Local Settings
\Application Data\Microsoft\ VisualStudio\8. 0\ProjectAssemb lies
\gyyihrso01\Tes tSettings.xml'.
at System.IO.__Err or.WinIOError(I nt32 errorCode, String maybeFullPath)
at System.IO.FileS tream.Init(Stri ng path, FileMode mode, FileAccess
access, Int32 rights, Boolean useRights, FileShare share, Int32
bufferSize, FileOptions options, SECURITY_ATTRIB UTES secAttrs, String
msgPath, Boolean bFromProxy)
at System.IO.FileS tream..ctor(Str ing path, FileMode mode, FileAccess
access, FileShare share, Int32 bufferSize)
at System.Xml.XmlD ownloadManager. GetStream(Uri uri, ICredentials
credentials)
at System.Xml.XmlU rlResolver.GetE ntity(Uri absoluteUri, String role,
Type ofObjectToRetur n)
at System.Xml.XmlT extReaderImpl.O penUrlDelegate( Object xmlResolver)
at System.Threadin g.CompressedSta ck.runTryCode(O bject userData)
at
System.Runtime. CompilerService s.RuntimeHelper s.ExecuteCodeWi thGuaranteedCle anup(TryCode
code, CleanupCode backoutCode, Object userData)
at System.Threadin g.CompressedSta ck.Run(Compress edStack
compressedStack , ContextCallback callback, Object state)
at System.Xml.XmlT extReaderImpl.O penUrl()
at System.Xml.XmlT extReaderImpl.R ead()
at System.Xml.XmlL oader.Load(XmlD ocument doc, XmlReader reader,
Boolean preserveWhitesp ace)
at System.Xml.XmlD ocument.Load(Xm lReader reader)
at System.Xml.XmlD ocument.Load(St ring filename)
at Test.DataManage r.LoadTestSetti ngs() in C:\Documents and Settings
\DanThMan\My Documents\Proje cts\Test\Develo pment\App Code\Test\Test
\DataManager.vb :line 46
at Test.DataManage r..ctor() in C:\Documents and Settings\DanThM an\My
Documents\Proje cts\Test\Develo pment\App Code\Test\Test
\DataManager.vb :line 33
at Test.DataManage r..cctor() in C:\Documents and Settings\DanThM an\My
Documents\Proje cts\Test\Develo pment\App Code\Test\Test
\DataManager.vb :line 20
I can't figure out what to specify for the filename in
XmlDocument.Loa d(string fileName). Does
My.Application. Info.DirectoryP ath not work if not in debug mode? If
not, what should I do to get the designer to open?
Thanks for your help,
-Dan
Thanks, Mark, but I get pretty much the same problem:
Could not find file 'C:\Program Files\Microsoft Visual Studio
8\Common7\IDE\T estSettings.xml '.
-Dan
On Feb 22, 8:44 pm, "Mark Cooney" <m...@mcooney.c o.ukwrote:
change rootpath to application.sta rtuppath
"DanThMan" <danth...@cox.n etwrote in message
news:11******** **************@ p10g2000cwp.goo glegroups.com.. .
The following code works when I debug and when I install the software
and run the .exe, but if I try to open the form in the designer (which
causes this code to run), I get an error:
Private Sub LoadTestSetting s()
Dim rootPath As String
Dim eventHandler As ValidationEvent Handler
rootPath = My.Application. Info.DirectoryP ath
eventHandler = New ValidationEvent Handler(Address Of
XmlValidationEv entHandler)
_xmlDocument = New XmlDocument()
_xmlDocument.Lo ad(rootPath & "\" & "TestSettings.x ml") '-->this is
where the error occurs<--
_xmlDocument.Sc hemas.Add("http ://tempuri.org/TestXmlSchema.x sd",
rootPath & "\" & "TestXmlSchema. xsd")
_xmlDocument.Va lidate(eventHan dler)
End Sub
If I try to open the form in the designer, I get this error:
Could not find file 'C:\Documents and Settings\DanThM an\Local Settings
\Application Data\Microsoft\ VisualStudio\8. 0\ProjectAssemb lies
\gyyihrso01\Tes tSettings.xml'.
at System.IO.__Err or.WinIOError(I nt32 errorCode, String maybeFullPath)
at System.IO.FileS tream.Init(Stri ng path, FileMode mode, FileAccess
access, Int32 rights, Boolean useRights, FileShare share, Int32
bufferSize, FileOptions options, SECURITY_ATTRIB UTES secAttrs, String
msgPath, Boolean bFromProxy)
at System.IO.FileS tream..ctor(Str ing path, FileMode mode, FileAccess
access, FileShare share, Int32 bufferSize)
at System.Xml.XmlD ownloadManager. GetStream(Uri uri, ICredentials
credentials)
at System.Xml.XmlU rlResolver.GetE ntity(Uri absoluteUri, String role,
Type ofObjectToRetur n)
at System.Xml.XmlT extReaderImpl.O penUrlDelegate( Object xmlResolver)
at System.Threadin g.CompressedSta ck.runTryCode(O bject userData)
at
System.Runtime. CompilerService s.RuntimeHelper s.ExecuteCodeWi thGuaranteedCle anup(TryCode
code, CleanupCode backoutCode, Object userData)
at System.Threadin g.CompressedSta ck.Run(Compress edStack
compressedStack , ContextCallback callback, Object state)
at System.Xml.XmlT extReaderImpl.O penUrl()
at System.Xml.XmlT extReaderImpl.R ead()
at System.Xml.XmlL oader.Load(XmlD ocument doc, XmlReader reader,
Boolean preserveWhitesp ace)
at System.Xml.XmlD ocument.Load(Xm lReader reader)
at System.Xml.XmlD ocument.Load(St ring filename)
at Test.DataManage r.LoadTestSetti ngs() in C:\Documents and Settings
\DanThMan\My Documents\Proje cts\Test\Develo pment\App Code\Test\Test
\DataManager.vb :line 46
at Test.DataManage r..ctor() in C:\Documents and Settings\DanThM an\My
Documents\Proje cts\Test\Develo pment\App Code\Test\Test
\DataManager.vb :line 33
at Test.DataManage r..cctor() in C:\Documents and Settings\DanThM an\My
Documents\Proje cts\Test\Develo pment\App Code\Test\Test
\DataManager.vb :line 20
I can't figure out what to specify for the filename in
XmlDocument.Loa d(string fileName). Does
My.Application. Info.DirectoryP ath not work if not in debug mode? If
not, what should I do to get the designer to open?
Thanks for your help,
-Dan
My.Application. Info.DirectoryP ath is your debug default directory, change it
too my.application. startuppath
"DanThMan" <da******@cox.n etwrote in message
news:11******** **************@ p10g2000cwp.goo glegroups.com.. .
The following code works when I debug and when I install the software
and run the .exe, but if I try to open the form in the designer (which
causes this code to run), I get an error:
Private Sub LoadTestSetting s()
Dim rootPath As String
Dim eventHandler As ValidationEvent Handler
rootPath = My.Application. Info.DirectoryP ath
eventHandler = New ValidationEvent Handler(Address Of
XmlValidationEv entHandler)
_xmlDocument = New XmlDocument()
_xmlDocument.Lo ad(rootPath & "\" & "TestSettings.x ml") '-->this is
where the error occurs<--
_xmlDocument.Sc hemas.Add("http ://tempuri.org/TestXmlSchema.x sd",
rootPath & "\" & "TestXmlSchema. xsd")
_xmlDocument.Va lidate(eventHan dler)
End Sub
If I try to open the form in the designer, I get this error:
Could not find file 'C:\Documents and Settings\DanThM an\Local Settings
\Application Data\Microsoft\ VisualStudio\8. 0\ProjectAssemb lies
\gyyihrso01\Tes tSettings.xml'.
at System.IO.__Err or.WinIOError(I nt32 errorCode, String maybeFullPath)
at System.IO.FileS tream.Init(Stri ng path, FileMode mode, FileAccess
access, Int32 rights, Boolean useRights, FileShare share, Int32
bufferSize, FileOptions options, SECURITY_ATTRIB UTES secAttrs, String
msgPath, Boolean bFromProxy)
at System.IO.FileS tream..ctor(Str ing path, FileMode mode, FileAccess
access, FileShare share, Int32 bufferSize)
at System.Xml.XmlD ownloadManager. GetStream(Uri uri, ICredentials
credentials)
at System.Xml.XmlU rlResolver.GetE ntity(Uri absoluteUri, String role,
Type ofObjectToRetur n)
at System.Xml.XmlT extReaderImpl.O penUrlDelegate( Object xmlResolver)
at System.Threadin g.CompressedSta ck.runTryCode(O bject userData)
at
System.Runtime. CompilerService s.RuntimeHelper s.ExecuteCodeWi thGuaranteedCle anup(TryCode
code, CleanupCode backoutCode, Object userData)
at System.Threadin g.CompressedSta ck.Run(Compress edStack
compressedStack , ContextCallback callback, Object state)
at System.Xml.XmlT extReaderImpl.O penUrl()
at System.Xml.XmlT extReaderImpl.R ead()
at System.Xml.XmlL oader.Load(XmlD ocument doc, XmlReader reader,
Boolean preserveWhitesp ace)
at System.Xml.XmlD ocument.Load(Xm lReader reader)
at System.Xml.XmlD ocument.Load(St ring filename)
at Test.DataManage r.LoadTestSetti ngs() in C:\Documents and Settings
\DanThMan\My Documents\Proje cts\Test\Develo pment\App Code\Test\Test
\DataManager.vb :line 46
at Test.DataManage r..ctor() in C:\Documents and Settings\DanThM an\My
Documents\Proje cts\Test\Develo pment\App Code\Test\Test
\DataManager.vb :line 33
at Test.DataManage r..cctor() in C:\Documents and Settings\DanThM an\My
Documents\Proje cts\Test\Develo pment\App Code\Test\Test
\DataManager.vb :line 20
I can't figure out what to specify for the filename in
XmlDocument.Loa d(string fileName). Does
My.Application. Info.DirectoryP ath not work if not in debug mode? If
not, what should I do to get the designer to open?
Thanks for your help,
-Dan
sorry read wrong posting
"DanThMan" <da******@cox.n etwrote in message
news:11******** *************@m 58g2000cwm.goog legroups.com...
Thanks, Mark, but I get pretty much the same problem:
Could not find file 'C:\Program Files\Microsoft Visual Studio
8\Common7\IDE\T estSettings.xml '.
-Dan
On Feb 22, 8:44 pm, "Mark Cooney" <m...@mcooney.c o.ukwrote:
>change rootpath to application.sta rtuppath
"DanThMan" <danth...@cox.n etwrote in message
news:11******* *************** @p10g2000cwp.go oglegroups.com. ..
The following code works when I debug and when I install the software
and run the .exe, but if I try to open the form in the designer (which
causes this code to run), I get an error:
Private Sub LoadTestSetting s()
Dim rootPath As String
Dim eventHandler As ValidationEvent Handler
rootPath = My.Application. Info.DirectoryP ath
eventHandler = New ValidationEvent Handler(Address Of
XmlValidationEv entHandler)
_xmlDocument = New XmlDocument()
_xmlDocument.Lo ad(rootPath & "\" & "TestSettings.x ml") '-->this is
where the error occurs<--
_xmlDocument.Sc hemas.Add("http ://tempuri.org/TestXmlSchema.x sd",
rootPath & "\" & "TestXmlSchema. xsd")
_xmlDocument.Va lidate(eventHan dler)
End Sub
If I try to open the form in the designer, I get this error:
Could not find file 'C:\Documents and Settings\DanThM an\Local Settings
\Application Data\Microsoft\ VisualStudio\8. 0\ProjectAssemb lies
\gyyihrso01\Tes tSettings.xml'.
at System.IO.__Err or.WinIOError(I nt32 errorCode, String maybeFullPath)
at System.IO.FileS tream.Init(Stri ng path, FileMode mode, FileAccess
access, Int32 rights, Boolean useRights, FileShare share, Int32
bufferSize, FileOptions options, SECURITY_ATTRIB UTES secAttrs, String
msgPath, Boolean bFromProxy)
at System.IO.FileS tream..ctor(Str ing path, FileMode mode, FileAccess
access, FileShare share, Int32 bufferSize)
at System.Xml.XmlD ownloadManager. GetStream(Uri uri, ICredentials
credentials)
at System.Xml.XmlU rlResolver.GetE ntity(Uri absoluteUri, String role,
Type ofObjectToRetur n)
at System.Xml.XmlT extReaderImpl.O penUrlDelegate( Object xmlResolver)
at System.Threadin g.CompressedSta ck.runTryCode(O bject userData)
at
System.Runtime. CompilerService s.RuntimeHelper s.ExecuteCodeWi thGuaranteedCle anup(TryCode
code, CleanupCode backoutCode, Object userData)
at System.Threadin g.CompressedSta ck.Run(Compress edStack
compressedStack , ContextCallback callback, Object state)
at System.Xml.XmlT extReaderImpl.O penUrl()
at System.Xml.XmlT extReaderImpl.R ead()
at System.Xml.XmlL oader.Load(XmlD ocument doc, XmlReader reader,
Boolean preserveWhitesp ace)
at System.Xml.XmlD ocument.Load(Xm lReader reader)
at System.Xml.XmlD ocument.Load(St ring filename)
at Test.DataManage r.LoadTestSetti ngs() in C:\Documents and Settings
\DanThMan\My Documents\Proje cts\Test\Develo pment\App Code\Test\Test
\DataManager.vb :line 46
at Test.DataManage r..ctor() in C:\Documents and Settings\DanThM an\My
Documents\Proje cts\Test\Develo pment\App Code\Test\Test
\DataManager.vb :line 33
at Test.DataManage r..cctor() in C:\Documents and Settings\DanThM an\My
Documents\Proje cts\Test\Develo pment\App Code\Test\Test
\DataManager.vb :line 20
I can't figure out what to specify for the filename in
XmlDocument.Loa d(string fileName). Does
My.Application. Info.DirectoryP ath not work if not in debug mode? If
not, what should I do to get the designer to open?
Thanks for your help,
-Dan
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Manfred Braun |
last post by:
Hi All,
I am trying to access xml-files in the internet from my intranet-page.
Making XmlDocument.Load() calls internally works fine, but not so to the
internet. I think the calls are failing, because we use a proxy-server.
Can I specify a specifix proxy in the call and/or in the
configuration-files? For the configuration-files, I am not finding samples,
which point out how to specify username and password. For the XmlDocument, I
even...
|
by: Gustaf Liljegren |
last post by:
I need to merge several XML files into one large. All of them has a DOCTYPE
tag, but the SYSTEM identifier points to a DTD that doesn't exist. (I use
the PUBLIC identifier with catalog files, so the SYSTEM identifiers has no
purpose in my application.)
Anyway, when I load each document, using XmlDocument.Load(file), I get a
FileNotFoundException, because of the DTD pointer in the SYSTEM identifier.
I'd rather skip all the entity...
|
by: Graham Pengelly |
last post by:
Hi
I am trying to transform on System.Xml.XmlDocument into another using
XslTransform without writing the object out to a file. I am guessing it
should work something like this...
public XmlDocument TransformXmlDoc(XmlDocument docToTransform, string
xsltFilePath)
{
//load the xslt
|
by: Peter Nofelt |
last post by:
Hey All,
I'm running into this issue with parsing through an xml document by
tag name. Below is an example xml document:
File Name: things.xml
<things>
<people>
<name>Peter</name>
|
by: delphiconsultingguy |
last post by:
Hi all,
Spent WAAAYYY too much time trying to figure this out because there's
not many good examples out there, so in the interest of sparing y'all
from suff'rin same, I've pasted it into eternity for you. Works like a
charm.
(I know, I know, I love you too)
Sean
| |
by: supercodepoet |
last post by:
I have cXml document I want to load to parse. The document has a
DOCTYPE element that points to an external dtd via http. When the
document loads it trys a web request which I am assuming is to get the
dtd. We have a proxy and this throws and exception when trying to load
the document becuase it could not authenticate through the proxy. Is
there anyway I can turn off the download?
|
by: DanThMan |
last post by:
The following code works when I debug and when I install the software
and run the .exe, but if I try to open the form in the designer (which
causes this code to run), I get an error:
Private Sub LoadTestSettings()
Dim rootPath As String
Dim eventHandler As ValidationEventHandler
rootPath = My.Application.Info.DirectoryPath
eventHandler = New ValidationEventHandler(AddressOf
XmlValidationEventHandler)
|
by: =?Utf-8?B?TWFyaw==?= |
last post by:
Hi...
We've got a lot of places in our code where we read relatively small xml
user preference blocks. Currently that's creating a new XmlDocument in every
spot. I was thinking we might see some speed improvements by having one,
central XmlDocument and using doc.ReadNode() to process all of the fragments.
Other than pumping up the NameTable with a mish-mash of different node names
and namespaces, are there any other implications I'm...
|
by: =?Utf-8?B?RGF2aWRHQg==?= |
last post by:
OK, so I've created and loaded an XMLDocument object.
But how do I go about using it? Specifically, how do I:
1) move to the first node (I assume I start on it when I load the XML?)
2) move to the next node (.read?)
3) move back to a previous node?
Is there a sample program somewhere to show this? (preferably VB.net)
TIA David
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |