Thanks, but this give me the same error as before.
In designmode VSC# is still looking in
'C:\Users\Anyone\AppData\Local\Microsoft\VCSExpress\9.0\ProjectAssemblies\ng2tm6b901\segments.xml'.
instead of
C:\Users\Anyone\Dokument\Visual Studio
2008\Projects\DotChar\DotChar\bin\Debug\segments.xml
as it does in run mode.
So I need a way of determine the run time path during design without hard
coding the path.
Is the file added to your solution? If not, add it to your solution and mark
the copy property to "copy always", and the build action to content. Then it
will copy it to the \bin\debug or \bin\results folder when you build, and
thus will be in application.startuppath.
RobinS.
GoldMail.com
-------------------------------
> Thanks, but this give me the same error as before.
>
[quoted text clipped - 20 lines]
>> Hope that helps,
>> Paul
TAB - 04 Sep 2008 08:13 GMT
Thanks for your answer.
The file exists in my debug and release folders and I have no problem
reading and writing the file when running the program.
But, I need to read the file in design mode as well, as it is a part of a
user control displayed during design. The problem is that in design mode the
Application.StartupPath
shows the path to VCSExpress folder instead of my project folder. This
results in an error when I open the form with the control in designer.
I can't include the file as a resource, as I need to write to it from time
to time.
TAB
> Is the file added to your solution? If not, add it to your solution and
> mark the copy property to "copy always", and the build action to content.
[quoted text clipped - 29 lines]
>>> Hope that helps,
>>> Paul
Jack Jackson - 04 Sep 2008 18:04 GMT
I spent quite a while trying to do exactly what you are doing, and was
never able to find a solution.
>Thanks for your answer.
>
[quoted text clipped - 44 lines]
>>>> Hope that helps,
>>>> Paul
TAB - 04 Sep 2008 19:44 GMT
Apparently nobody seems to know, so my last solution was to use the
Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)
to store my .xml file.
I don't know if this should be considered a bug or not?
Anyway it's nice to see I'm not alone.
> I spent quite a while trying to do exactly what you are doing, and was
> never able to find a solution.
[quoted text clipped - 50 lines]
>>>>> Hope that helps,
>>>>> Paul
Jeff Gaines - 04 Sep 2008 23:01 GMT
>Apparently nobody seems to know, so my last solution was to use the
>Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)
>to store my .xml file.
>I don't know if this should be considered a bug or not?
>Anyway it's nice to see I'm not alone.
I don't know if it's a bug.
I have a note in my Toolbox:
The recommended folder for user settings is:
System.Windows.Forms.Application.UserAppDataPath
for common application settings:
System.Windows.Forms.Application.CommonAppDataPath
This makes sure users can read/write the data in Vista (XP is not so
fussy) so I think your solution is probably best anyway.

Signature
Jeff Gaines Damerham Hampshire UK
You can't tell which way the train went by looking at the tracks
TAB - 06 Sep 2008 08:57 GMT
I checked these out also, but they are hard to find if you would like to
edit or copy the file manually.
I suppose most users know where there documents are located so decided to
use that folder.
>>Apparently nobody seems to know, so my last solution was to use the
>>Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)
[quoted text clipped - 13 lines]
> This makes sure users can read/write the data in Vista (XP is not so
> fussy) so I think your solution is probably best anyway.
Jeff Gaines - 06 Sep 2008 09:21 GMT
>I suppose most users know where there documents are located so decided to
>use that folder.
I think we have a new definition of an optimist :-)

Signature
Jeff Gaines Damerham Hampshire UK
You can't tell which way the train went by looking at the tracks
TAB - 06 Sep 2008 16:36 GMT
Well, sombody has to be. :-)
> On 06/09/2008 in message <O6aPxY$DJHA.4492@TK2MSFTNGP05.phx.gbl> TAB
> wrote:
[quoted text clipped - 3 lines]
>
> I think we have a new definition of an optimist :-)