Home All Groups Group Topic Archive Search About

VB.Net File.Copy Conundrum

Author
15 Mar 2006 5:32 PM
RitaG
Hello.

I have a VB.Net program that copies a file from one server to another server.
This program has been working without any problems for about a year.
A couple of weeks ago the "server from" crashed and had to be rebuilt.
Now, when the File.Copy method in the VB.Net program is executed an error
occurs about 90% of the time, always with a larger file.

Here's the line of code:
   File.Copy(sFileName, sDistributionPathFile)

Is there some timeout property somewhere that needs to be set to resolve
this issue? When first setting up this program I don't recall having to do
this.

TIA.

Rita

Author
15 Mar 2006 6:09 PM
James Jardine
Show quote Hide quote
"RitaG" <Ri***@discussions.microsoft.com> wrote in message
news:A2B10186-ADD9-4EDB-87BB-596C95490F49@microsoft.com...
> Hello.
>
> I have a VB.Net program that copies a file from one server to another
> server.
> This program has been working without any problems for about a year.
> A couple of weeks ago the "server from" crashed and had to be rebuilt.
> Now, when the File.Copy method in the VB.Net program is executed an error
> occurs about 90% of the time, always with a larger file.
>
> Here's the line of code:
>   File.Copy(sFileName, sDistributionPathFile)
>
> Is there some timeout property somewhere that needs to be set to resolve
> this issue? When first setting up this program I don't recall having to do
> this.
>
> TIA.
>
> Rita
>
>

What is the exception you are receiving.?  I am not sure if there are any
time outs for a file.copy.   Is this a asp.net or winform application.   If
it is asp.net then you could be getting a time out from the request time
out.  If it is winform or console there should not be a time out.

jjardine
Author
15 Mar 2006 6:30 PM
RitaG
Hi James.

Thanks for your response. The program is a Windows Application.
The File.Copy is within a Try statement but I dont actually check the
exception.

  Try
    File.Copy(sDestinationPathFileQA, sDistributionPathFile)
  Catch e As Exception
    sStr = "Error copying file (" & sDestinationPathFileQA & _
              ") to distribution server("& sDistributionPathFile & ")"
    ......

I will change the Catch routine to check the error message.
Thanks for that!

Rita

Show quoteHide quote
"James Jardine" wrote:

>
> "RitaG" <Ri***@discussions.microsoft.com> wrote in message
> news:A2B10186-ADD9-4EDB-87BB-596C95490F49@microsoft.com...
> > Hello.
> >
> > I have a VB.Net program that copies a file from one server to another
> > server.
> > This program has been working without any problems for about a year.
> > A couple of weeks ago the "server from" crashed and had to be rebuilt.
> > Now, when the File.Copy method in the VB.Net program is executed an error
> > occurs about 90% of the time, always with a larger file.
> >
> > Here's the line of code:
> >   File.Copy(sFileName, sDistributionPathFile)
> >
> > Is there some timeout property somewhere that needs to be set to resolve
> > this issue? When first setting up this program I don't recall having to do
> > this.
> >
> > TIA.
> >
> > Rita
> >
> >
>
> What is the exception you are receiving.?  I am not sure if there are any
> time outs for a file.copy.   Is this a asp.net or winform application.   If
> it is asp.net then you could be getting a time out from the request time
> out.  If it is winform or console there should not be a time out.
>
> jjardine
>
>
>
Author
15 Mar 2006 7:05 PM
James Jardine
Show quote Hide quote
"RitaG" <Ri***@discussions.microsoft.com> wrote in message
news:30C94498-E5BC-4A9B-8695-0D631C88E643@microsoft.com...
> Hi James.
>
> Thanks for your response. The program is a Windows Application.
> The File.Copy is within a Try statement but I dont actually check the
> exception.
>
>  Try
>    File.Copy(sDestinationPathFileQA, sDistributionPathFile)
>  Catch e As Exception
>    sStr = "Error copying file (" & sDestinationPathFileQA & _
>              ") to distribution server("& sDistributionPathFile & ")"
>    ......
>
> I will change the Catch routine to check the error message.
> Thanks for that!
>
> Rita
>
> "James Jardine" wrote:
>
>>
>> "RitaG" <Ri***@discussions.microsoft.com> wrote in message
>> news:A2B10186-ADD9-4EDB-87BB-596C95490F49@microsoft.com...
>> > Hello.
>> >
>> > I have a VB.Net program that copies a file from one server to another
>> > server.
>> > This program has been working without any problems for about a year.
>> > A couple of weeks ago the "server from" crashed and had to be rebuilt.
>> > Now, when the File.Copy method in the VB.Net program is executed an
>> > error
>> > occurs about 90% of the time, always with a larger file.
>> >
>> > Here's the line of code:
>> >   File.Copy(sFileName, sDistributionPathFile)
>> >
>> > Is there some timeout property somewhere that needs to be set to
>> > resolve
>> > this issue? When first setting up this program I don't recall having to
>> > do
>> > this.
>> >
>> > TIA.
>> >
>> > Rita
>> >
>> >
>>
>> What is the exception you are receiving.?  I am not sure if there are any
>> time outs for a file.copy.   Is this a asp.net or winform application.
>> If
>> it is asp.net then you could be getting a time out from the request time
>> out.  If it is winform or console there should not be a time out.
>>
>> jjardine
>>
>>
>>

What operating systems are the two machines running.  Also what version of
..net are you using?
Author
15 Mar 2006 10:27 PM
RitaG
James,

The error message is:
   "The semaphore timeout period has expired."

Show quoteHide quote
"James Jardine" wrote:

>
> "RitaG" <Ri***@discussions.microsoft.com> wrote in message
> news:30C94498-E5BC-4A9B-8695-0D631C88E643@microsoft.com...
> > Hi James.
> >
> > Thanks for your response. The program is a Windows Application.
> > The File.Copy is within a Try statement but I dont actually check the
> > exception.
> >
> >  Try
> >    File.Copy(sDestinationPathFileQA, sDistributionPathFile)
> >  Catch e As Exception
> >    sStr = "Error copying file (" & sDestinationPathFileQA & _
> >              ") to distribution server("& sDistributionPathFile & ")"
> >    ......
> >
> > I will change the Catch routine to check the error message.
> > Thanks for that!
> >
> > Rita
> >
> > "James Jardine" wrote:
> >
> >>
> >> "RitaG" <Ri***@discussions.microsoft.com> wrote in message
> >> news:A2B10186-ADD9-4EDB-87BB-596C95490F49@microsoft.com...
> >> > Hello.
> >> >
> >> > I have a VB.Net program that copies a file from one server to another
> >> > server.
> >> > This program has been working without any problems for about a year.
> >> > A couple of weeks ago the "server from" crashed and had to be rebuilt.
> >> > Now, when the File.Copy method in the VB.Net program is executed an
> >> > error
> >> > occurs about 90% of the time, always with a larger file.
> >> >
> >> > Here's the line of code:
> >> >   File.Copy(sFileName, sDistributionPathFile)
> >> >
> >> > Is there some timeout property somewhere that needs to be set to
> >> > resolve
> >> > this issue? When first setting up this program I don't recall having to
> >> > do
> >> > this.
> >> >
> >> > TIA.
> >> >
> >> > Rita
> >> >
> >> >
> >>
> >> What is the exception you are receiving.?  I am not sure if there are any
> >> time outs for a file.copy.   Is this a asp.net or winform application.
> >> If
> >> it is asp.net then you could be getting a time out from the request time
> >> out.  If it is winform or console there should not be a time out.
> >>
> >> jjardine
> >>
> >>
> >>
>
> What operating systems are the two machines running.  Also what version of
> ..net are you using?
>
>
>
Author
16 Mar 2006 2:06 PM
James Jardine
Show quote Hide quote
"RitaG" <Ri***@discussions.microsoft.com> wrote in message
news:E3FB2A71-E7F3-4121-90DE-853FE6669296@microsoft.com...
> James,
>
> The error message is:
>   "The semaphore timeout period has expired."
>
> "James Jardine" wrote:
>
>>
>> "RitaG" <Ri***@discussions.microsoft.com> wrote in message
>> news:30C94498-E5BC-4A9B-8695-0D631C88E643@microsoft.com...
>> > Hi James.
>> >
>> > Thanks for your response. The program is a Windows Application.
>> > The File.Copy is within a Try statement but I dont actually check the
>> > exception.
>> >
>> >  Try
>> >    File.Copy(sDestinationPathFileQA, sDistributionPathFile)
>> >  Catch e As Exception
>> >    sStr = "Error copying file (" & sDestinationPathFileQA & _
>> >              ") to distribution server("& sDistributionPathFile & ")"
>> >    ......
>> >
>> > I will change the Catch routine to check the error message.
>> > Thanks for that!
>> >
>> > Rita
>> >
>> > "James Jardine" wrote:
>> >
>> >>
>> >> "RitaG" <Ri***@discussions.microsoft.com> wrote in message
>> >> news:A2B10186-ADD9-4EDB-87BB-596C95490F49@microsoft.com...
>> >> > Hello.
>> >> >
>> >> > I have a VB.Net program that copies a file from one server to
>> >> > another
>> >> > server.
>> >> > This program has been working without any problems for about a year.
>> >> > A couple of weeks ago the "server from" crashed and had to be
>> >> > rebuilt.
>> >> > Now, when the File.Copy method in the VB.Net program is executed an
>> >> > error
>> >> > occurs about 90% of the time, always with a larger file.
>> >> >
>> >> > Here's the line of code:
>> >> >   File.Copy(sFileName, sDistributionPathFile)
>> >> >
>> >> > Is there some timeout property somewhere that needs to be set to
>> >> > resolve
>> >> > this issue? When first setting up this program I don't recall having
>> >> > to
>> >> > do
>> >> > this.
>> >> >
>> >> > TIA.
>> >> >
>> >> > Rita
>> >> >
>> >> >
>> >>
>> >> What is the exception you are receiving.?  I am not sure if there are
>> >> any
>> >> time outs for a file.copy.   Is this a asp.net or winform application.
>> >> If
>> >> it is asp.net then you could be getting a time out from the request
>> >> time
>> >> out.  If it is winform or console there should not be a time out.
>> >>
>> >> jjardine
>> >>
>> >>
>> >>
>>
>> What operating systems are the two machines running.  Also what version
>> of
>> ..net are you using?
>>
>>
>>

What Operating System are you using?    here is an article on microsoft
talking about a semaphore timeout  if you are using win NT   I will let you
know if I find any other items about this.
http://support.microsoft.com/default.aspx?scid=kb;en-us;169742

jjardine
Author
16 Mar 2006 3:31 PM
RitaG
Both servers have Windows 2003.
I'm using VB.Net Development Environment 2003 7.1 and Net Framework 1.1.

I found an article at Microsoft's Web site where they suggest a Registry
change.
http://support.microsoft.com/kb/892100/en-us.

Thanks,
Rita


Show quoteHide quote
"James Jardine" wrote:

>
> "RitaG" <Ri***@discussions.microsoft.com> wrote in message
> news:E3FB2A71-E7F3-4121-90DE-853FE6669296@microsoft.com...
> > James,
> >
> > The error message is:
> >   "The semaphore timeout period has expired."
> >
> > "James Jardine" wrote:
> >
> >>
> >> "RitaG" <Ri***@discussions.microsoft.com> wrote in message
> >> news:30C94498-E5BC-4A9B-8695-0D631C88E643@microsoft.com...
> >> > Hi James.
> >> >
> >> > Thanks for your response. The program is a Windows Application.
> >> > The File.Copy is within a Try statement but I dont actually check the
> >> > exception.
> >> >
> >> >  Try
> >> >    File.Copy(sDestinationPathFileQA, sDistributionPathFile)
> >> >  Catch e As Exception
> >> >    sStr = "Error copying file (" & sDestinationPathFileQA & _
> >> >              ") to distribution server("& sDistributionPathFile & ")"
> >> >    ......
> >> >
> >> > I will change the Catch routine to check the error message.
> >> > Thanks for that!
> >> >
> >> > Rita
> >> >
> >> > "James Jardine" wrote:
> >> >
> >> >>
> >> >> "RitaG" <Ri***@discussions.microsoft.com> wrote in message
> >> >> news:A2B10186-ADD9-4EDB-87BB-596C95490F49@microsoft.com...
> >> >> > Hello.
> >> >> >
> >> >> > I have a VB.Net program that copies a file from one server to
> >> >> > another
> >> >> > server.
> >> >> > This program has been working without any problems for about a year.
> >> >> > A couple of weeks ago the "server from" crashed and had to be
> >> >> > rebuilt.
> >> >> > Now, when the File.Copy method in the VB.Net program is executed an
> >> >> > error
> >> >> > occurs about 90% of the time, always with a larger file.
> >> >> >
> >> >> > Here's the line of code:
> >> >> >   File.Copy(sFileName, sDistributionPathFile)
> >> >> >
> >> >> > Is there some timeout property somewhere that needs to be set to
> >> >> > resolve
> >> >> > this issue? When first setting up this program I don't recall having
> >> >> > to
> >> >> > do
> >> >> > this.
> >> >> >
> >> >> > TIA.
> >> >> >
> >> >> > Rita
> >> >> >
> >> >> >
> >> >>
> >> >> What is the exception you are receiving.?  I am not sure if there are
> >> >> any
> >> >> time outs for a file.copy.   Is this a asp.net or winform application.
> >> >> If
> >> >> it is asp.net then you could be getting a time out from the request
> >> >> time
> >> >> out.  If it is winform or console there should not be a time out.
> >> >>
> >> >> jjardine
> >> >>
> >> >>
> >> >>
> >>
> >> What operating systems are the two machines running.  Also what version
> >> of
> >> ..net are you using?
> >>
> >>
> >>
>
> What Operating System are you using?    here is an article on microsoft
> talking about a semaphore timeout  if you are using win NT   I will let you
> know if I find any other items about this.
> http://support.microsoft.com/default.aspx?scid=kb;en-us;169742
>
> jjardine
>
>
>