Click here to Skip to main content
15,888,401 members
Home / Discussions / C#
   

C#

 
QuestionNetwork Scanning Pin
satsumatable18-Apr-10 19:39
satsumatable18-Apr-10 19:39 
Questiondeploying web service on windows 7 Pin
Ice_Freez0518-Apr-10 18:56
Ice_Freez0518-Apr-10 18:56 
AnswerRe: deploying web service on windows 7 Pin
Calla18-Apr-10 21:36
Calla18-Apr-10 21:36 
GeneralRe: deploying web service on windows 7 Pin
Ice_Freez0518-Apr-10 23:28
Ice_Freez0518-Apr-10 23:28 
GeneralRe: deploying web service on windows 7 Pin
Calla19-Apr-10 0:09
Calla19-Apr-10 0:09 
GeneralRe: deploying web service on windows 7 Pin
Ice_Freez0519-Apr-10 15:13
Ice_Freez0519-Apr-10 15:13 
AnswerRe: deploying web service on windows 7 Pin
Md. Marufuzzaman19-Apr-10 0:18
professionalMd. Marufuzzaman19-Apr-10 0:18 
QuestionWeird delay when writing a file Pin
svanwass18-Apr-10 13:34
svanwass18-Apr-10 13:34 
I am getting a weird delay when writing a file. I am not able to figure out where the delay is coming from.

The facts:

I map a drive to a NT server (W:\)
I copy a file at W:\largefile.dat to W:\Archive\largefile.dat

My copy loop:
try
{
	using (FileStream sourceStream = new FileStream(nd_CopyDrive.LocalDrive + "\\" + fi.Name, FileMode.Open))
	{
		byte[] buffer = new byte[64 * 1024];
		using (FileStream destStream = new FileStream(nd_CopyDrive.LocalDrive + "\\Archive\\" + fi.Name, FileMode.Create))
		{
			int q;
			while ((q = sourceStream.Read(buffer, 0, buffer.Length)) > 0)
			{
				destStream.Write(buffer, 0, q);
			}
		}
	}
}


When the file is completely written my program hangs at the closing bracket for the second using statement.

Nothing is shown in the Output window that gives me some clues. This block of code IS running in a background worker as added information.

Could my problem be related to how the CLR "releases the memory used to store objects that are no longer required".

If I place a debug marker at that ending bracket and perform a step into, the Output window shows:
Step into: Stepping over method without symbols 'System.IO.Stream.Dispose' (which takes forever to complete)


Any help would be greatly appreciated!
AnswerRe: Weird delay when writing a file Pin
Richard Andrew x6418-Apr-10 13:45
professionalRichard Andrew x6418-Apr-10 13:45 
GeneralRe: Weird delay when writing a file Pin
Not Active18-Apr-10 14:21
mentorNot Active18-Apr-10 14:21 
GeneralRe: Weird delay when writing a file Pin
Richard Andrew x6418-Apr-10 14:23
professionalRichard Andrew x6418-Apr-10 14:23 
GeneralRe: Weird delay when writing a file Pin
Not Active18-Apr-10 14:32
mentorNot Active18-Apr-10 14:32 
GeneralRe: Weird delay when writing a file Pin
Richard Andrew x6418-Apr-10 14:35
professionalRichard Andrew x6418-Apr-10 14:35 
GeneralRe: Weird delay when writing a file Pin
Not Active18-Apr-10 14:40
mentorNot Active18-Apr-10 14:40 
GeneralRe: Weird delay when writing a file Pin
Richard Andrew x6418-Apr-10 14:44
professionalRichard Andrew x6418-Apr-10 14:44 
GeneralRe: Weird delay when writing a file Pin
svanwass18-Apr-10 14:56
svanwass18-Apr-10 14:56 
GeneralRe: Weird delay when writing a file Pin
Not Active18-Apr-10 15:05
mentorNot Active18-Apr-10 15:05 
AnswerRe: Weird delay when writing a file Pin
Not Active18-Apr-10 14:35
mentorNot Active18-Apr-10 14:35 
GeneralRe: Weird delay when writing a file Pin
svanwass18-Apr-10 14:56
svanwass18-Apr-10 14:56 
GeneralRe: Weird delay when writing a file Pin
Not Active18-Apr-10 15:01
mentorNot Active18-Apr-10 15:01 
GeneralRe: Weird delay when writing a file Pin
svanwass18-Apr-10 15:08
svanwass18-Apr-10 15:08 
GeneralRe: Weird delay when writing a file Pin
Not Active18-Apr-10 15:12
mentorNot Active18-Apr-10 15:12 
GeneralRe: Weird delay when writing a file Pin
svanwass18-Apr-10 15:18
svanwass18-Apr-10 15:18 
GeneralRe: Weird delay when writing a file Pin
Not Active18-Apr-10 15:33
mentorNot Active18-Apr-10 15:33 
GeneralRe: Weird delay when writing a file Pin
svanwass18-Apr-10 15:44
svanwass18-Apr-10 15:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.