Fix for: "Unable to get the project file from the Web server" error

In .NET on October 28, 2006 at 7:58 pm

Visit for amazingly detailed quality articles on Computer, Internet, Browsers, Software, Programming and much more.

For those of us who deals with the reality of ASP.NET/Visual Studio.NET IDE day-in and day-out, here is a trick which I hope would be handy for you if not today, well at some point of time.

So, lets say you had a perfectly working ASP.NET Site/Web Service and that goes nicely with the Visual Studio.NET IDE. As in any normal development lifecycle we might wanted to tinger with the service/site by moving it to a different machine or location and things like that without forgetting the fact that at times we might even wanted to change some settings with IIS. Fine. So what?

Well, when you mess up with any settings or your site/service your VS.NET IDE doesn’t go nice with IIS anymore. Yes, it complains with the above dialog, with the message "Unable to get the project file from Web server. Unable to open Web project <projectname>. The file path <path> does not correspond to the URL <URL>. The two need to map to the save server location. HTTP Error 403: Access Forbidden." And most of the time it just suck up your development time to fix this issue and think about this happening at a crucial time. Well, it did happen to me last time when I badly wanted my IDE to work.

You and I know from the above message that it has something to do with the .webinfo file having a wrong mapping. Well, in both the instances when I faced this that wasn’t been the case. Then I made sure the IIS Virtual Directory points to the correct local path, recreated IIS application etc. and nothing seems to resolve. Then this simple fix made it to work and that is going to be my fix for this issue.

So, what I really did? Pretty simple. I just deleted my virtual directory in IIS and then recreated it again. Restarted IIS and bingo. My IDE was able to play nice with IIS again.

Hope it helps.

PS: If the above solution doesn’t work or is not a choice for you then try this one. Find the "VSWebCache\<ProjectName>" folder under your Documents and Settings folder and delete it and try it again.

Visit for amazingly detailed quality articles on Computer, Internet, Browsers, Software, Programming and much more.

  1. Hai,
    thank you so much for the wonderful description of the know how about the error…i had this error long time before and left it its working perfectly…the following helped a lot….
    PS: If the above solution doesn’t work or is not a choice for you then try this one. Find the “VSWebCache\” folder under your Documents and Settings folder and delete it and try it again

  2. Amala…I’m glad that it helped.

  3. Amala: You rule

  4. Hi,

    I m highly pleased with the solution. I used the second part i.e VSWebCache\”, and it served the purpose in less time.
    Thank you.

  5. Appan…I’m glad that it helped.

  6. i searched for this Solution everyWhere, i didn’t got ne where but sorry for this that ur solution seems to be bullshit, how can u say to delete a virtual directory, thr’s huge confugration in some config files if deleting that virtual directory..

  7. Brad – I think there might be a misunderstanding with what I said. What I meant by deleting the virtual directory is you delete the virtual directory in IIS not your physical directory. I thought that is common sense to not have a solution that tells you to delete the physical directory, rather what I meant was to recreate your virtual directory. Hope that clarifies.

  8. Sure am glad that I found this article before I attempted to fix this problem with other suggestions…Simple solution to an aggravating problem. Thanks!

  9. I looked online for 2 days for a solution before i read your post, the second solution worked great. Thanks!!!!!!

  10. This would work for me if a more detailed explanation than “delete your IIS virtual directory” was supplied, since I don’t know how to do that. IIS Manager Help index doesn’t mention it, there’s nothing in the Properties dialogs that mentions it, so I’m left with absolutely no idea of how to implement the described solution.

  11. Deleting the file under Documents and Settings works, though. Still….

  12. Brook – It is pretty simple. Open up your IIS Manager. Locate the virtual directory for which you were getting this error. Just delete it and then recreate the virtual directory again. Restart IIS. And that should be it. You shouldn’t get this dialog anymore. Let me know if you still find it hard.

  13. thanks man..

  14. tnx. deleting in the vswebcache solved my problem. again tnx.

  15. Thanks a lot bro.. it’s really helped me

  16. Hi,

    Excellent post!!!!



  17. it’s work.

  18. It’s work!!
    Thank’s for your message!!

  19. Deleting vsewcache saved my day, many thanks!

  20. I got is correct after creating
    1) .csproj.webinfo file
    2) .csproj file
    in the website directory which is virtually mapped in IIS.

  21. Hi,

    I have an application which is on a development server.

    I need to access that folder for development from my local server.

    How do I do it.Can you please help.

  22. Hours and hours of bashing my head and the problem has not gone away. Deleted, recreated Virtual dir. Deleted VSWebCache\.
    If the Virtual dir doesn’t exist when I open the solution I get an error saying it can’t read the project from the Web, as expected. When I create a new virtual dir pointing at C:\whatever\ and then try to open it, it asks me to select a working location and suggests.. http://localhost/_1
    I remove the _1 suffix and it gives the error pictured above. Basically no matter what I do it, it doesn’t think the virtual dir, and the real dir point to the same place, even though they do, by definition.

  23. Oh well, my last comment thrashed by parser. Should be Projname in every path and URL.

  24. Wallllaaaahhh, It is time saver shortcut.

  25. thanx alot it works now

  26. it may be caused by the excluded files.
    remove them or inlude them to the related project


  27. Thanx a lot……….it’s working after using second approach

  28. You really digged me out of that issue by second approach, Thanks Alot

  29. deleting “VSWebCache\” worked well. thanks

  30. there is my respect for you.
    second trick has been really greate.

  31. This was a life saver! Thanks!

  32. There has come winter 😦
    It became cold and cloudy!
    Mood very bad 😦
    Depression Begins

  33. Cool.. deleting the VSCache folder worked!

  34. thanks that helped

  35. Thanks!!!! That helped a lot!!!!!!!!!!!!!!


    Daniel Hernandez

  36. Over two years later and your post is still saving people hours of fuss. Deleting the respective VSWebCache folders did the trick for me. Thanks, askars!

  37. I copy the project in different directory and trying to rename it at that time its affecting my original project directory also. because of that not able to open that projecet in dotnet but on browser its work properly. but because of not opening in dot net I am not able to make changes in my project which I want to enhance that one…

  38. hi
    good luck

  39. It helped me. Thanks a lot!

  40. You are a life saver, I sank a good 2 hours trying to figure out what was going on!

  41. This post really helped us out. I’d been fighting this error for hours but it turned out to be your P.S. that was the problem. What’s it storing in the VSWebCache that was messing it up?

  42. You’re absolutely awesome!

    This kind of issue made me waste two hours of work. Thanks to you, I solved it before it went on for two more hours.

  43. I restarted the IIS service.

    I deleted the VScache folder in my document and settings folder.

    I deleted the virtual directory and created a new one pointing to the solution file folder.

    I tried to open the solution 2003 it saying the same error “unable to get the project file from the web server.”

    Please help me in this.

  44. Thanks a ton.. this resolved my issue…

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: