Visual Studio built-in server adds directory (locally)

Hello,

This has been an annoyance for a while now. When running a website project locally, the built-in server makes the root "localhost:port/directory/", where directory is the name of the directory in which the project resides. This creates a problem once you start adding css files with background images that use absolute path. Is there a way to have it run locally without it appending the directory name or some other way that will allow to use absolute paths locally?

Thanks!
luefherAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob LearnedCommented:
Why do you need to use absolute paths with CSS styles?

Bob
0
luefherAuthor Commented:
no particuluar reason, i am used to using absolute paths...
0
Bob LearnedCommented:
Things work best with relative paths, since you can rehome a web site without having to change anything.  A lot of ASP.NET examples will show relative pathing.  I think that your problem will evaporate with relative pathing.

Bob
0
luefherAuthor Commented:
Found the solution:

When you have a project running on a local server, click on the project name in the solution explorer and change the virtual path to '/' in the properties. That does it!
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.