We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,901 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

How to get the Virtual Directory's physical path...

Hi,

I hv create an application using C#, Asp.Net (VS2005), While Im creating setup project for that application, I add Custom Installer Class (for getting user input and update my web.config connection string at the time of installation). Its working fine. (the custom installer class automatically crates a file in application's bin folder named CustomInstaller.InstallState when install - I dont know how any why)

But when I am uninstalling the application, the UnInstaller process wont remove the physical folder in my wwwroot folder, and it wont remove the virtual dir also (Because the file CustomInstaller.InstallState didn't get removed from the bin folder)

Now I need to remove all the physical directory and the virtual dir, when i uninstall the application. (I plan to get the physical path of the application and the virtual directory name when install, so that I can store that in a text file and can use it when install), but I cant get the physicall path of that vDir,

Any Idea pls..
Thank you in advance

3
Contributors
2
Replies
4 Years
Discussion Span
9 Months Ago
Last Updated
3
Views
mop
Newbie Poster
1 post since Jan 2008
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

to find the physical path, you have to know where it is based from the root of the folder. THen you can create a dummy aspx page to find your virtual path. THe dummy page will contain:

<%= server.MapPath("/vdir/") %>

This will show you the physical path to the vdir.

SheSaidImaPregy
Veteran Poster
1,080 posts since Sep 2007
Reputation Points: 43
Solved Threads: 69
Skill Endorsements: 11

This approach will fail for virtual paths that maps to physical paths with more that 260 characters long. I have not found a work around for it yet.

zyzzyxx
Newbie Poster
1 post since Aug 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0575 seconds using 2.65MB