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

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

am 07.01.2008 14:06:35 von bryan rasmussen

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:




C:\RenditionServerQ\InjectorQ\OnDemandQ





If I do the following:

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

RE: path is not of a legal form for FileSystemWatcher if I get path fr

am 07.01.2008 17:42:03 von FamilyTreeMike

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:
>
>
>
>
> C:\RenditionServerQ\InjectorQ\OnDemandQ
>

>

>

>
>
> If I do the following:
>
> EventLog.WriteEntry(ConfigurationManager.AppSettings["Render ingQ"]);
> I get a blank entry in the event log. So what's that about?
>
>

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

am 08.01.2008 10:24:34 von bryan rasmussen

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:




C:\RenditionServerQ\InjectorQ\OnDemandQ




give a blank value for this


ConfigurationManager.AppSettings["RenderingQ"]



On Jan 7, 5:42 pm, Family Tree Mike
wrote:
> 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:
>
> >
> >
> >
> > C:\RenditionServerQ\InjectorQ\OnDemandQ
> >

> >

> >

>
> > If I do the following:
>
> > EventLog.WriteEntry(ConfigurationManager.AppSettings["Render ingQ"]);
> > I get a blank entry in the event log. So what's that about?

Re: path is not of a legal form for FileSystemWatcher if I get pat

am 08.01.2008 12:39:00 von FamilyTreeMike

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:
>
>
>
>
> C:\RenditionServerQ\InjectorQ\OnDemandQ
>

>

>

>
> give a blank value for this
>
>
> ConfigurationManager.AppSettings["RenderingQ"]
>
>
>
> On Jan 7, 5:42 pm, Family Tree Mike
> wrote:
> > 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:
> >
> > >
> > >
> > >
> > > C:\RenditionServerQ\InjectorQ\OnDemandQ
> > >

> > >

> > >

> >
> > > If I do the following:
> >
> > > EventLog.WriteEntry(ConfigurationManager.AppSettings["Render ingQ"]);
> > > I get a blank entry in the event log. So what's that about?
>