.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using FileSystemWatcher breaks defined commands

6 REPLIES 6
Reply
Message 1 of 7
Anonymous
567 Views, 6 Replies

Using FileSystemWatcher breaks defined commands

I don't know if this is a bug in Acad .net api or what, but
I'm trying to set up a simple file watcher routine inside my
C# app. The routine itself works fine, no errors or warnings
on compile, but it has the odd side effect that ALL commands
defined in my app ( [CommandMethod("blabla")], yes they are all
public & static), seem to vanish from Acads frontal lobes. I get
an "unknown" command with them all.
As soon as I comment out the filewatcher code, Acad sees my commands
again. The filewatcher code is being initialized in my main function
which implements IExtensionApplication.

Has anyone else run into this oddity? Anyone got any Ideas on how
to fix it?

Thanks for any suggestions
Perry
6 REPLIES 6
Message 2 of 7
Anonymous
in reply to: Anonymous

So I'm the only one to do this?
I feel like such a trailblazer !
Message 3 of 7
Anonymous
in reply to: Anonymous

A bit off topic.

Why do you watch file system on each Acad session? Are the file system on
local hard drive, or on a network location (so many uses would create many
watchers when they start their Acad. It is very bad idea, IMO)?

FileSystem watch is an expensive component to run, because its buffer
comsume non-paged memory. Also, if you have multiple watcher monitoring file
system on a older OS (Win2K server), when there is file change, only one
watcher fires event. That is what makes me wondering why you monitoring file
system on each Acad session.


"perry" wrote in message
news:5713897@discussion.autodesk.com...
I don't know if this is a bug in Acad .net api or what, but
I'm trying to set up a simple file watcher routine inside my
C# app. The routine itself works fine, no errors or warnings
on compile, but it has the odd side effect that ALL commands
defined in my app ( [CommandMethod("blabla")], yes they are all
public & static), seem to vanish from Acads frontal lobes. I get
an "unknown" command with them all.
As soon as I comment out the filewatcher code, Acad sees my commands
again. The filewatcher code is being initialized in my main function
which implements IExtensionApplication.

Has anyone else run into this oddity? Anyone got any Ideas on how
to fix it?

Thanks for any suggestions
Perry
Message 4 of 7
Anonymous
in reply to: Anonymous

Are you the only one to do what?

Use FileSystemWatcher, or put buggy code in
your IExtensionApplication.Initialize() (which
the AutoCAD managed runtime supresses and
hides exceptions that it may be throwing)?

Which do you mean?

If your commands aren't being defined, then
there's an exception being thrown in your
Initialize(), that AutoCAD is supressing.

You can search these newsgroups for more
info on that.

You could have done that first, before you
posted the query and the foot-stomping
post that usually follows whenever you don't
get the attention you seem to think you're
entitled to.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

"perry" wrote in message news:5715729@discussion.autodesk.com...
So I'm the only one to do this?
I feel like such a trailblazer !
Message 5 of 7
Anonymous
in reply to: Anonymous

Norman Yuan wrote:
> A bit off topic.
>
> Why do you watch file system on each Acad session? Are the file system on
> local hard drive, or on a network location (so many uses would create many
> watchers when they start their Acad. It is very bad idea, IMO)?
>
> FileSystem watch is an expensive component to run, because its buffer
> comsume non-paged memory. Also, if you have multiple watcher monitoring file
> system on a older OS (Win2K server), when there is file change, only one
> watcher fires event. That is what makes me wondering why you monitoring file
> system on each Acad session.

I had set a single watcher on a local directory for the purpose of
informing me if a drawing had been deleted from the "current" directory.
If so, I would remove its entry in an ini file I maintain for the
customer in that directory.
Yes, the watcher is "expensive" and if it becomes too expensive I will
abandon it as it not a terribly crucial function, just a nicety.
Message 6 of 7
Anonymous
in reply to: Anonymous

Tony Tanzillo wrote:
> Are you the only one to do what?
>
> Use FileSystemWatcher, or put buggy code in
> your IExtensionApplication.Initialize() (which
> the AutoCAD managed runtime supresses and
> hides exceptions that it may be throwing)?
>
> Which do you mean?
>
> If your commands aren't being defined, then
> there's an exception being thrown in your
> Initialize(), that AutoCAD is supressing.
>
> You can search these newsgroups for more
> info on that.
>
> You could have done that first, before you
> posted the query and the foot-stomping
> post that usually follows whenever you don't
> get the attention you seem to think you're
> entitled to.
>
Well, if I were really doing some "footstomping", we
would not be having this conversation. You would be
too busy wiping the boot marks of that arrogant mouth
of yours.
Message 7 of 7
Anonymous
in reply to: Anonymous

You're more than welcome anytime you want,
to come here and do some foot stomping.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

"perry" wrote in message news:5716336@discussion.autodesk.com...
Tony Tanzillo wrote:
> Are you the only one to do what?
>
> Use FileSystemWatcher, or put buggy code in
> your IExtensionApplication.Initialize() (which
> the AutoCAD managed runtime supresses and
> hides exceptions that it may be throwing)?
>
> Which do you mean?
>
> If your commands aren't being defined, then
> there's an exception being thrown in your
> Initialize(), that AutoCAD is supressing.
>
> You can search these newsgroups for more
> info on that.
>
> You could have done that first, before you
> posted the query and the foot-stomping
> post that usually follows whenever you don't
> get the attention you seem to think you're
> entitled to.
>
Well, if I were really doing some "footstomping", we
would not be having this conversation. You would be
too busy wiping the boot marks of that arrogant mouth
of yours.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost