473,398 Members | 2,368 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,398 software developers and data experts.

VB.Net File.Copy Conundrum

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
Mar 15 '06 #1
6 9614

"RitaG" <Ri***@discussions.microsoft.com> wrote in message
news:A2**********************************@microsof t.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
Mar 15 '06 #2
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:A2**********************************@microsof t.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

Mar 15 '06 #3

"RitaG" <Ri***@discussions.microsoft.com> wrote in message
news:30**********************************@microsof t.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:A2**********************************@microsof t.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?
Mar 15 '06 #4
James,

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

"James Jardine" wrote:

"RitaG" <Ri***@discussions.microsoft.com> wrote in message
news:30**********************************@microsof t.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:A2**********************************@microsof t.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?

Mar 15 '06 #5

"RitaG" <Ri***@discussions.microsoft.com> wrote in message
news:E3**********************************@microsof t.com...
James,

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

"James Jardine" wrote:

"RitaG" <Ri***@discussions.microsoft.com> wrote in message
news:30**********************************@microsof t.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:A2**********************************@microsof t.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...b;en-us;169742

jjardine
Mar 16 '06 #6
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
"James Jardine" wrote:

"RitaG" <Ri***@discussions.microsoft.com> wrote in message
news:E3**********************************@microsof t.com...
James,

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

"James Jardine" wrote:

"RitaG" <Ri***@discussions.microsoft.com> wrote in message
news:30**********************************@microsof t.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:A2**********************************@microsof t.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...b;en-us;169742

jjardine

Mar 16 '06 #7

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

Similar topics

2
by: RitaG | last post by:
Hi. In a VB.Net program I use File.Copy to copy some zipped (and text) files from one server to another. I'm required by management to do a file compare after the copy has completed. Is the...
4
by: Neil10365 | last post by:
I wonder if someone can help me with a small conundrum I am having. This is what I want to achieve: Scenario -------- Each week, I import an excel spreadsheet called Week1.xls into an access...
3
by: syntax | last post by:
hi, i want to read a file using fread() in equal chunks through a for loop so that at the last call i dont get error..which way, i should read it? let me give an example, suppose i have 100...
4
by: Jim Owen | last post by:
I am storing all my application data in the application cache. Anytime I have a method as part of an asp.net form, I need to access the objects in the cache. The only way I can think of to do this...
8
by: luis molina Micasoft | last post by:
it seems that when i do file.copy the svchost.exe is hanged, i mean if i make 40 threads of file.copy , 40 copys of files at same time the system is going down and stop responding, this is when i'm...
1
by: brianbasquille | last post by:
Hello all, Hope you can help me with this little conundrum! I'm running a batch file and want to print the execution of it line-by-line. Best reference i could find was:...
2
by: subnunciation | last post by:
i know, this shouldnt be a conundrum right? one just shouldnt divide by zero. but this is suddenly happening *all over* my site. after chasing the error here and there, i simplified things down to:...
0
Tog
by: Tog | last post by:
Hello all. here is a little conundrum for you to get your teeth into. I am creating a csv file from an access database. The code I use is below and it works well .. except for one small...
3
by: maheshkadam | last post by:
Hi friends I am new to perl so please guide me. I have one application which created backup log file every day.But it appends that file so you can see logs for different day in one file only. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.