IIS7 Virtual directory file path problem


I just installed IIS7 on my dev computer for debugging my application and changed in visual studio 2008 to IIS7 from asp development server.
The IIS7 created a virtual directory for me namned http://localhost/myapplication.

Now when I try to request for example my cssfile with a starting slash like "/css/style.css" the application cant find the file. Its the same with user controls, javascripts, images if the path starts with a slash.

Can I do some setup so the server doesnt look down a folder to much to http://localhost/ for the files? 
Any help is appreciated, thanks.

4/29/2009 7:46:10 AM
asp.net.config-deploy 12495 articles. 0 followers. Follow

3 Replies

Similar Articles

[PageSpeed] 32

 Go througth this link







Please remember to click “Mark as Answer” on the post that helps you.
This can be beneficial to other community members reading the thread.
4/29/2009 8:46:15 AM

Hi Asif,

Thanks for your quick reply.
I read the links you posted but still cant figure it out. Is it something with authentication?

When I deploy my application on the production server everything works like a charm because its not a virtual directory, its just a "root project" (the only project/app on the server located in wwwroot. But now I need to debug my application locally but cant change all my paths to js, images, css and user controls just for local testing.

For example when I change my css-link from /css/style.css to css/style.css it works.
Is there any setup I can do in IIS7 or web.config so my the application is like the root application and the file paths look at http://localhost/myapp and not at http://localhost/ ?

4/29/2009 9:11:13 AM


From your description, I understand that if you request file the path of which starts with a slash, this file won't be returned.

If we try to use another Browser, does it have the same issue? Please try to convert it to application by clicking "Convert To Application" on IIS 7.0.

You also can try to run your website in Classic ASP.NET mode. For more information, see http://www.codeproject.com/KB/aspnet/IIS7ASPNet.aspx


I look forward to receiving your test results.

Thomas Sun
Microsoft Online Community Support

Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question.
5/5/2009 6:34:23 AM

Similar Artilces:

Virtual Path Provider on IIS7 has problem with virtual css files
Hi All,Using VS2008 I have a website using VPP in IIS6. Works perfectly, couldn't be happier!After putting the website on II7 (windows svr 2008) the site has an issue producing/consuming Virtual CSS's.   In IIS6 you just set up a wildcard mapping to route any request through the aspnet_isapi.dll, and then handle the forwarding with internal logic. It doesn't work the same way with IIS7 and everyone seems to be hacking around the issue, eg: http://devtalk.dk/2007/03/19/Wildcard+Mapping+And+URL+Rewriting+On+IIS7.aspxthe above doesn't work for me. The BIG differe...

Virtual directory virtual path problems
Hi there, Can anyone tell me if there is a way to use a virtual path when navigating around a site in a virtual directory. ie. http://localhost/Test_Site If I go to /default.aspx it goes up a level like this: http://localhost/default.aspx But I need it to go: http://localhost/Test_Site/default.aspx Is this possible? G.when in doubt.....RUUUUUUUUUUUUUUUUUN! if you are somewhere in the localhost/TestSite and you just navigate to default, it takes you up a level? are you sure you arent adding periods, like NavigateUrl="../default.aspx" instead of NavogateUrl=...

Deploy from local to host, virtual path problems with images and file access
Hi everyone, hopefully someone can help me with this because I'm really going bonkers finding a bunch of answers that just don't work. Here's my situation: 1) I created a asp.net project in VS in http://localhost/msweb (ps: I hate that you can't just create it in http://localhost). 2) All my pages are created with codebehind files and some .vb components that contain the menu templates 3) The menus are generated from a database, in a .vb component that builds the parameters for the Flash file (the database will be changed to an XML file later on, but I'm trying to work one step a...

VS - File "~/myTemplate/myMaster.master" was not found
 hi,i have to create some asp.net projects (web application projects) for the same company. all should have the same layout. therefore i created an asp.net project (web application project) that includes a master page, css, js files and images. lets call this asp.net project "myTemplate".i created 3 separate asp.net projects (say web1, web2, web3). everyone has a virtual directory "myTemplate" configured in iis to "include" the above mentioned "myTemplate" project root. all the *.aspx files (in web1 to web 3) reference the masterpage with MasterPa...

Problem with SiteURLS.config / Web.Config default file path.
Here is how i setup the forums http://domain.com/forums In the Web.Config, i put in /forums/ I did nothing with SiteURLs.config. I copied the Themes directory to the root of the web server. (http://domain.com/Themes). I can connect the database, however all the links on http://domain.com/forums/default.aspx, point to URLs such as http://domain.com/ShowForum.aspx, it is not appending the forums directory. What is the proper setup of AspNetForums when the forums directory is not under the root. Thanks, Mike.If an answer has been provided to you question please mark it as an an...

Access problems for .aspx files but not .htm files in virtual directory
I'm setting up IIS 5.1 on XP Pro SP2. I have a virtual directory with 1 ..htm and 2 .aspx files. IIS can see all 3 files from its explorer and it can display the the .,htm file in its browser with no problem but I get a file access problem ... Server cannot access application directory 'C:\Documents and Settings\peter\My Documents\SW\WebProg\SW\HelloWorld\HelloWorldVirtDir\'. The directory does not exist or is not accessible because of security settings. .... on the two .aspx files. If I put all 3 files in Inetpub\wwwroot there's no problem displaying/executing...

web.config and virtual directory problems
Greetings, I have a problem. At my company we regularly create new .net web apps - however we cannot easily access our web servers - the are locked down. So I am trying to find away were we can just upload our new apps without having to create a new IIS application everytime. My plan was to set up one directory as an application and have a new ..net apps inside this - so we have one application folder on iis  - and each new asp.net app we create can go into its own folder with the application folder. I tried this and it just errored when I tried to run myhost.com/dotne...

Problems with uploading files on virtual directory
Hi, I have finished an application which uploads files with the html control   input type="file". I select from the file selector the file which I want to upload and click a button I made labelled 'attach' at which point the file is moved from the source directory to another designated directory. This all worked fine in the Visual Studio.NET IDE. However, when I uploaded the whole code to a virtual directory (giving the latter read and write permissions and internet guest account full permissions), when I browse for the file and click 'Attach' nothing happens. No error message is ...

Question on Config Files and Directory Paths...
I am Breaking up some code from the web and have a Quick question on one of the lines in the web.config file. It relates to the appsettings section, now I know that this is custom fields but.... <add key="ErrorLogFile" value="~/Logs/ErrorLog.txt" /> With the above line can some one please explain the directory path and what the ~ means. At present I have never used this (Normally a winforms develpoer). Does this mean that the path leads to a file that is off the root of the virtual directory... ? Virtual RealmXNA and Game Programing Resources The tilde (...

Problem with Directory path in webconfig file
I am running .Text as a website (localpath: C:\Websites\bva\DotText\DottextWeb) and under that I am running nGallery as a virtual web (local path: C:\Websites\bva\nGallery\ngallery). In my webconfig file I have following lines: <add key="AdminDirectory" value="admin" /> <add key="DataDirectory" value="data/" /> <add key="TemplateDirectory" value="templates/" /> <add key="PhotosDirectory" value="photos/" /> The gallery is working fine showing some photos but I can't go to ...

Not selecting file from local path.. checks file path from where i have deployed the application
Hi,  Am trying to insert blob field to oracle database.When am trying to do this from my local system it always works fine(am browsing  the file which i have to upload to databse), but when i deploy the application in DDE(in our development environment) it is not working.When i deploy the application and try the link from my system and select the file which i have to upload it is checking the file where i deployed the application and am getting 'file path' is not a valid virtual path.and file not found error.Actually it always checks the file from where i deployed the appli...

file path to config file
I have a generic class that I wrote for sending emails.  This class has a xml configuration file associated with it.  It belongs to its on project/DLL.  I want to use this class in a web application and stand alone application.  I'm having problems writing the code generic enough where it will run in both environments.  How do you code the piece to find the configuration file in the path.  I'm not able to use the below code segment since this class is not part of a web project.  String fullpath = HttpContext.Current.Server.MapPath(@"configFile...

Deployment Error,virtual directory,web.config
hi i have created an application it is working fine on the local computer but when i upload it to the webserver it is giving me this error  Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS. Source Error: Line 50: ASP.NET to identify an incoming user. Line 51: --> Line 52: and it point to the <authentication mode="Forms">   thanks` Check whether you created the virutual...

capture image file directory path problem.
ok guys i have no problem capturing the file directory path to my text box using this code below: <script type ="text/javascript">function Button1_onclick(){    document.getElementById('File1').click();}function fileChange(){    document.getElementById('Text1').value= document.getElementById('File1').value ;}</script>        <input id="File1" style="position: static; display:none " type="file" onchange="fileChange()"/>   &...

Web resources about - IIS7 Virtual directory file path problem - asp.net.config-deploy

Wikipedia:Quick directory - Wikipedia, the free encyclopedia
This page is a handy directory to various locations of interest in Wikipedia. Only dynamic pages should be listed here, no policy pages etc. ...

Wikipedia:WikiProject Council/Directory - Wikipedia, the free encyclopedia
Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc. , a non-profit organization.

Business Directory Listings: Eight Smart Tips for You to Get Started
If you are considering a business directory listing for your small business, congratulations – you are on the right track. Local SEO, local customers, ...

LinkedIn Lookup iOS app aims to replace your company’s awful intranet employee directory
... continue reading at 9to5Mac . What do you think? Discuss "LinkedIn Lookup iOS app aims to replace your company’s awful intranet employee directory" ...

Atlas Partner Directory Launched
... just for Facebook and Instagram –advertising platform Atlas has one, as well. On that note, Atlas Tuesday introduced the Atlas Partner Directory ...

Slack announces App Directory store
... create more apps for the store, and a new framework called Botkit which should simplify the process of creating apps. The Slack App Directory, ...

The British Library’s ‘Save Our Sounds’ Program Creates Directory of UK Sound Collections
The long-feared deterioration of the world's sound collections is a coming to a head with the British Library's last-ditch initiative called ...

Researchers show how to steal Windows Active Directory credentials from the Internet
... showed at the Black Hat security conference. The attack, called an SMB relay, causes a Windows computer that's part of an Active Directory ...

Researchers find way to steal Windows Active Directory credentials from the Internet
The technique could enable attackers to attack Windows servers hosted in the cloud

Slack's App Directory proves it's more than just a chatroom
... are about to get a little easier to find and integrate within your team and over 160 of them live within the company's new Slack App Directory. ...

Resources last updated: 1/22/2016 11:12:08 PM