Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / Extensibility / February 2006

Tip: Looking for answers? Try searching our database.

Long running macro in .NET 2003 causes odd error message...

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
snichols - 23 Feb 2006 02:13 GMT
I have a very long-running macro for .NET 2003.  In essence, it
traverses every code file in my solution and uses the code dom to do
some analysis and refactoring work.  It will run for quite a long time
without issue.  However, after a long enough run, I get the error
message "System call failed".

Is anyone aware of a built-in timeout on macro run time?  It seems that
about 20 minutes is all I can get before the error pops up.

I've looked high and low for a method to offload the macro to another
thread for processing.  I mean, I don't want to have the IDE freak out
on me.  Can anyone point me in the right direction for this problem?

Any help would be appreciated!

steve
Boni - 23 Feb 2006 09:31 GMT
Hi Steve,
I had more or less the same problem, which I solved using try catch block.
I.E
1. copy list of files from DTE to arraylist
2.for each file in arraylist
try
do something
catch
log("error when processing file"+X)
end

Sometimes in batch process DTE seems to hang and generate exceptions. I just
retry after some delay.
HIH,
Boni
>I have a very long-running macro for .NET 2003.  In essence, it
> traverses every code file in my solution and uses the code dom to do
[quoted text clipped - 12 lines]
>
> steve
snichols - 23 Feb 2006 16:57 GMT
Interesting.  I see that step one involves copying a list of files from
DTE to your own list.  Is that the preferred method of dealing with DTE
data?  To copy it?

Also, do you implement your delay in the macro itself?  Or do you rerun
your macro starting where it last left off?

steve
Boni - 24 Feb 2006 15:15 GMT
Hi Steve
> Interesting.  I see that step one involves copying a list of files from
> DTE to your own list.  Is that the preferred method of dealing with DTE
> data?  To copy it?
For me it was a workaround. I dont think it is proposed way.

> Also, do you implement your delay in the macro itself?  Or do you rerun
> your macro starting where it last left off?
Hear is pseudocode:

while counter<maxnumof repetitions
try
DoWork
exit while
catch (e as exception)
counter+=1
thread.sleep(100)
end catch
end while

With best regards,
snichols - 27 Feb 2006 19:53 GMT
Thanks for the info.  Here's what I found:

VS .NET 2003 macros run in another process.  They communicate with the
IDE via some form of IPC (Inter Process Communication).  It seems that
the connection between the macro host and the IDE can be lost
occasionally.

When I converted my macro to an add-in, this problem was resolved.
Add-ins run in the same process as the IDE and, as such, they don't
lose connection.

steve

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.