Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I'm having frustrating problems wit

Status
Not open for further replies.

mikeEd

Programmer
Nov 26, 2001
160
GB
I'm having frustrating problems with files being locked using VS beta 2.

If I do for example,
Code:
Bitmap bmp = new Bitmap(Image.FromFile("image.jpg"));
bmp.Dispose();
FileInfo file = new FileInfo("image.jpg");
file.Delete();
I get an IOException, as the file is supposedly "in use by another process".
Is this a known issue in the beta? Or am I doing something wrong?
Thanks
 
What did you do to solve it?

Thanks.
Chip H.
 
I just forced garbage collection after the Dispose call.
 
That would take care of it, I guess.

I think the delayed GC in .NET is going to be causing more and more people problems like this. Not quite time to add a FAQ about it, but something to keep in mind.

Chip H.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top