PC Review


Reply
Thread Tools Rate Thread

Directory.Delete of a non empty dir fails in ASP.NET application

 
 
=?Utf-8?B?T2xpdmllciBHSUw=?=
Guest
Posts: n/a
 
      26th Oct 2006
Hello,

The method Directory.Delete(path, true) of .NET 2.0 called from within a web
app does not work correctly if the initial directory is not empty : all the
files inside the root directory and subdirectories are actually deleted, but
the leaf subdirectories in the tree remain "locked" (they are not accessible
anymore by the webapp or by Windows Explorer) until the webapp ends.

When the web app is ended, the leaf subdirectories actually disappear in the
explorer.

The directory to delete is inside the virtual dir of the web app.

When I try to delete recursively the files with File.Delete before calling
Directory.Delete, I get exactly the same problem.

Is there any fix to this problem ?

--
Olivier GIL
LAFON SA
 
Reply With Quote
 
 
 
 
Walter Wang [MSFT]
Guest
Posts: n/a
 
      27th Oct 2006
Hi Olivier,

Based on my test, the folder is locked by Visual Studio 2005 IDE if the
folder is already shown in project explorer. If you publish it in IIS and
run from there, the directories should be deleted correctly.

Unfortunately VS2005 Web Site mode doesn't have an option to let you
exclude the folders from your web site. If you want, you can use the Web
Application Project add-on for VS2005 for author your web site using normal
project mode like in VS2003 and ASP.NET 1.1. In this way, you can exclude
the folders from your project from project explorer and it will not lock
the folders.

#Visual Studio 2005 Web Application Project Option
http://webproject.scottgu.com/

Sincerely,
Walter Wang ((E-Mail Removed), remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

 
Reply With Quote
 
=?Utf-8?B?T2xpdmllciBHSUw=?=
Guest
Posts: n/a
 
      27th Oct 2006
Thank you Walter for the explanation. Unfortunalely, the Visual Studio 2005
support for Web applications is only available in english at the moment, and
I can not install it in my localized version (french). I hope it will be
integrated in a future service pack for Visual Studio 2005.
--
Olivier GIL
LAFON SA


"Walter Wang [MSFT]" wrote:

> Hi Olivier,
>
> Based on my test, the folder is locked by Visual Studio 2005 IDE if the
> folder is already shown in project explorer. If you publish it in IIS and
> run from there, the directories should be deleted correctly.
>
> Unfortunately VS2005 Web Site mode doesn't have an option to let you
> exclude the folders from your web site. If you want, you can use the Web
> Application Project add-on for VS2005 for author your web site using normal
> project mode like in VS2003 and ASP.NET 1.1. In this way, you can exclude
> the folders from your project from project explorer and it will not lock
> the folders.
>
> #Visual Studio 2005 Web Application Project Option
> http://webproject.scottgu.com/
>
> Sincerely,
> Walter Wang ((E-Mail Removed), remove 'online.')
> Microsoft Online Community Support
>
> ==================================================
> Get notification to my posts through email? Please refer to
> http://msdn.microsoft.com/subscripti...ult.aspx#notif
> ications. If you are using Outlook Express, please make sure you clear the
> check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
> promptly.
>
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
> http://msdn.microsoft.com/subscripti...t/default.aspx.
> ==================================================
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>

 
Reply With Quote
 
Walter Wang [MSFT]
Guest
Posts: n/a
 
      30th Oct 2006
Hi Olivier,

Thank you for your update.

I'm sorry that currently the Web Application Project add-on is only
available for English version of VS2005.

I'm afraid we will have to use other workaround for this issue. Based on my
test, the folder will not be locked by VS2005 IDE if it's not visible in
the Project Explorer. Do you think it's feasible that you create the folder
in explorer after you opened the web site in VS2005. Unless you do a
"Refresh" in Project Explorer, the folder will not be seen by the IDE.

Please feel free to submit your feedback at
http://connect.microsoft.com/Main/co...ContentID=2220.
Thank you for your understanding.

Regards,
Walter Wang ((E-Mail Removed), remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

 
Reply With Quote
 
=?Utf-8?B?T2xpdmllciBHSUw=?=
Guest
Posts: n/a
 
      9th Nov 2006
Hi,

It will be difficult because VS2005 refreshes the Project Explorer each time
I start VS2005. I will submit the feedback as you suggested.

Thank you.

--
Olivier GIL
LAFON SA


"Walter Wang [MSFT]" wrote:

> Hi Olivier,
>
> Thank you for your update.
>
> I'm sorry that currently the Web Application Project add-on is only
> available for English version of VS2005.
>
> I'm afraid we will have to use other workaround for this issue. Based on my
> test, the folder will not be locked by VS2005 IDE if it's not visible in
> the Project Explorer. Do you think it's feasible that you create the folder
> in explorer after you opened the web site in VS2005. Unless you do a
> "Refresh" in Project Explorer, the folder will not be seen by the IDE.
>
> Please feel free to submit your feedback at
> http://connect.microsoft.com/Main/co...ContentID=2220.
> Thank you for your understanding.
>
> Regards,
> Walter Wang ((E-Mail Removed), remove 'online.')
> Microsoft Online Community Support
>
> ==================================================
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ==================================================
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>

 
Reply With Quote
 
Walter Wang [MSFT]
Guest
Posts: n/a
 
      10th Nov 2006
Hi Olivier,

Thank you for follow-up. Yes unfortunately VS2005 will refresh the Project
Explorer on startup, although it will not refresh it automatically after
the solution is already opened. I'm sorry for the inconvenience and thank
you for your feedback on the connect site.

Regards,
Walter Wang ((E-Mail Removed), remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fails to delete empty rows Len Microsoft Excel Programming 4 21st May 2010 03:38 AM
Mount NTFS to A empty; Unable to Delete a empty directory amontse@gmail.com Windows XP Help 2 9th Mar 2006 01:44 AM
Cannot delete empty directory Ritter197 Windows XP Help 23 10th Jan 2005 07:09 PM
Can't delete empty sub-directory So'n'so Windows XP Help 2 27th Apr 2004 04:58 AM
Can't Delete Empty Directory until Log off / Log On Geoffrey Hacker Windows XP Basics 3 7th Jan 2004 12:51 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:12 AM.