473,320 Members | 1,691 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

path is not of a legal form for FileSystemWatcher if I get path fromAppSettings

Hi,

the following:

FileSystemWatcher watcher = new FileSystemWatcher();
RenderingQ = ConfigurationSettings.AppSettings["RenderingQ"];
//RenderingQ = "C:\\RenditionServerQ\\InjectorQ\\OnDemandQ";
watcher.Path = RenderingQ;

raises the following error:

An unhandled exception of type 'System.ArgumentException' occurred in
mscorlib.dll

Additional information: The path is not of a legal form.

It's somewhat weird because
1. I have tried with both C:\\RenditionServerQ\\InjectorQ\\OnDemandQ
and C:\RenditionServerQ\InjectorQ\OnDemandQ as the value of the
RenderingQ configuration app settings.

2. RenderingQ is declared as a string.

The configuration settings are as follows:

<userSettings>
<WindowsService2.Properties.Settings>
<setting name="RenderingQ" serializeAs="String">
<value>C:\RenditionServerQ\InjectorQ\OnDemandQ</value>
</setting>
</WindowsService2.Properties.Settings>
</userSettings>
If I do the following:

EventLog.WriteEntry(ConfigurationManager.AppSettin gs["RenderingQ"]);
I get a blank entry in the event log. So what's that about?

Jan 7 '08 #1
3 6960
Well, I think that getting a blank in the event log is telling you there is
something wrong with the setting that you are loading. A blank value would
give you an illegal form error for the path on the file system watcher.

"pantagruel" wrote:
Hi,

the following:

FileSystemWatcher watcher = new FileSystemWatcher();
RenderingQ = ConfigurationSettings.AppSettings["RenderingQ"];
//RenderingQ = "C:\\RenditionServerQ\\InjectorQ\\OnDemandQ";
watcher.Path = RenderingQ;

raises the following error:

An unhandled exception of type 'System.ArgumentException' occurred in
mscorlib.dll

Additional information: The path is not of a legal form.

It's somewhat weird because
1. I have tried with both C:\\RenditionServerQ\\InjectorQ\\OnDemandQ
and C:\RenditionServerQ\InjectorQ\OnDemandQ as the value of the
RenderingQ configuration app settings.

2. RenderingQ is declared as a string.

The configuration settings are as follows:

<userSettings>
<WindowsService2.Properties.Settings>
<setting name="RenderingQ" serializeAs="String">
<value>C:\RenditionServerQ\InjectorQ\OnDemandQ</value>
</setting>
</WindowsService2.Properties.Settings>
</userSettings>
If I do the following:

EventLog.WriteEntry(ConfigurationManager.AppSettin gs["RenderingQ"]);
I get a blank entry in the event log. So what's that about?

Jan 7 '08 #2

Yeah, I suppose there's something wrong as well. But I can't really
see what that is. The setting name is the same as the value I am
passing, certainly looks like it above. I've tried two different path
values.
I've tried with both ConfigurationManager.AppSettings and
ConfigurationSettings.AppSettings,

So the question is why would this as my app settings:

<userSettings>
<WindowsService2.Properties.Settings>
<setting name="RenderingQ" serializeAs="String">
<value>C:\RenditionServerQ\InjectorQ\OnDemandQ</value>
</setting>
</WindowsService2.Properties.Settings>
</userSettings>

give a blank value for this
ConfigurationManager.AppSettings["RenderingQ"]

On Jan 7, 5:42 pm, Family Tree Mike
<FamilyTreeM...@discussions.microsoft.comwrote:
Well, I think that getting a blank in the event log is telling you there is
something wrong with the setting that you are loading. A blank value would
give you an illegal form error for the path on the file system watcher.

"pantagruel" wrote:
Hi,
the following:
FileSystemWatcher watcher = new FileSystemWatcher();
RenderingQ = ConfigurationSettings.AppSettings["RenderingQ"];
//RenderingQ = "C:\\RenditionServerQ\\InjectorQ\\OnDemandQ";
watcher.Path = RenderingQ;
raises the following error:
An unhandled exception of type 'System.ArgumentException' occurred in
mscorlib.dll
Additional information: The path is not of a legal form.
It's somewhat weird because
1. I have tried with both C:\\RenditionServerQ\\InjectorQ\\OnDemandQ
and C:\RenditionServerQ\InjectorQ\OnDemandQ as the value of the
RenderingQ configuration app settings.
2. RenderingQ is declared as a string.
The configuration settings are as follows:
<userSettings>
<WindowsService2.Properties.Settings>
<setting name="RenderingQ" serializeAs="String">
<value>C:\RenditionServerQ\InjectorQ\OnDemandQ</value>
</setting>
</WindowsService2.Properties.Settings>
</userSettings>
If I do the following:
EventLog.WriteEntry(ConfigurationManager.AppSettin gs["RenderingQ"]);
I get a blank entry in the event log. So what's that about?
Jan 8 '08 #3
Are you getting any values from your settings that are valid?

If not, try something like the following and see if your code is having
trouble finding the config file.

string[] keys = appSettings.AllKeys;

Console.WriteLine();
Console.WriteLine("Application appSettings:");

// Loop to get key/value pairs.
for (int i = 0; i < appSettings.Count; i++)

Console.WriteLine("#{0} Name: {1} Value: {2}",
i, keys[i], appSettings[i]);

"pantagruel" wrote:
>
Yeah, I suppose there's something wrong as well. But I can't really
see what that is. The setting name is the same as the value I am
passing, certainly looks like it above. I've tried two different path
values.
I've tried with both ConfigurationManager.AppSettings and
ConfigurationSettings.AppSettings,

So the question is why would this as my app settings:

<userSettings>
<WindowsService2.Properties.Settings>
<setting name="RenderingQ" serializeAs="String">
<value>C:\RenditionServerQ\InjectorQ\OnDemandQ</value>
</setting>
</WindowsService2.Properties.Settings>
</userSettings>

give a blank value for this
ConfigurationManager.AppSettings["RenderingQ"]

On Jan 7, 5:42 pm, Family Tree Mike
<FamilyTreeM...@discussions.microsoft.comwrote:
Well, I think that getting a blank in the event log is telling you there is
something wrong with the setting that you are loading. A blank value would
give you an illegal form error for the path on the file system watcher.

"pantagruel" wrote:
Hi,
the following:
FileSystemWatcher watcher = new FileSystemWatcher();
RenderingQ = ConfigurationSettings.AppSettings["RenderingQ"];
//RenderingQ = "C:\\RenditionServerQ\\InjectorQ\\OnDemandQ";
watcher.Path = RenderingQ;
raises the following error:
An unhandled exception of type 'System.ArgumentException' occurred in
mscorlib.dll
Additional information: The path is not of a legal form.
It's somewhat weird because
1. I have tried with both C:\\RenditionServerQ\\InjectorQ\\OnDemandQ
and C:\RenditionServerQ\InjectorQ\OnDemandQ as the value of the
RenderingQ configuration app settings.
2. RenderingQ is declared as a string.
The configuration settings are as follows:
<userSettings>
<WindowsService2.Properties.Settings>
<setting name="RenderingQ" serializeAs="String">
<value>C:\RenditionServerQ\InjectorQ\OnDemandQ</value>
</setting>
</WindowsService2.Properties.Settings>
</userSettings>
If I do the following:
EventLog.WriteEntry(ConfigurationManager.AppSettin gs["RenderingQ"]);
I get a blank entry in the event log. So what's that about?
Jan 8 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Brian | last post by:
Hello all. I've created a FileSystemWatcher that is to reside on Server A and monitor the activity of folder on Server B. The application works fine with watcher.path set to C:\. However,...
4
by: eyal | last post by:
Hi, I need to detect changes on several directory at the same time. for example: D:\temp c:\docs and so on. the problem is that this component have 1 'Path' in it's attribute. how can i solve...
10
by: Jeff Grantham | last post by:
I have the code below and it does what i want except for one thing and I can't for the life of me figure it out. It makes multiple copies of the entries in the Event Log and sends multiple emails....
2
by: Mike Johnson | last post by:
I have a Form named Form1 which I added a FileSystemWatcher component, I need to change the Path property on this component. I've read the Article Working with forms which I got from this News...
1
by: Fredrik Johansson | last post by:
Hello, I have built a .NET remoting solution (SingleCall) that writes a file to disk, then waits for a second file in a specified folder (using the FileSystemWatcher.WaitForChanged method). When...
1
by: greg_slavin | last post by:
I'm attempting to use the FileSystemWatcher class to monitor a folder on a remote server. My app is running as a Windows service, currently on an XP machine, but it will be on Server 2003 in...
15
by: Angelo | last post by:
Hi all, I'm using a FileSystemWatcher to monitor a directory. I want the FSW to pop up my already instantiated but invisible form. However, I'm running into some problems with this. 1) In...
1
by: GS | last post by:
I got this warning for an vb application when I opened it in vb .net studio 2005 express Warning 1 The path is not of a legal form. 0 0 I thought it was project reference path. I checked and...
2
by: zu1u | last post by:
Hi guys, i'd like to use FileSystemWatcher to monitor all FileSystem Events on all my hard drives. Now i tried "/", "\\" or "\\.\" and similar as paths.. but I only receive events from my C:\ drive....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.