1

I'm debugging a site that is deployed to the site root on the production server, but in my local copy, under the built-in, debugging web server, the URL's include the 'site name'. E.g. my local site is 'PVLive', so all URL's are 'localhost:nnnnn/PVLive/mmmm.aspx'. Certain URL's are hard coded in the site's pages to use paths relative to the root, e.g. I get errors when code tries to redirect to 'localhost:nnnnn/Index.aspx'.

Can I do something to keep the 'PVLive' site name out of the URL's?

3 Answers 3

4

Yes you can change the url that your site is run on in cassini (the built in dev server).

I have written an article about this before which you can read here:

The steps from the article are:

  1. In the Solution Explorer window you select your Project node
  2. In the Properties window (press F4 if you can't see it) you change the "Virtual path" attribute from /ProjectName to /

But you should read the article if you like screenshots and some background info.

Sign up to request clarification or add additional context in comments.

Comments

1

Can you change your hard coding?

e.g. Response.Redirect("~/Index.aspx") 

will build a path relative to your root.

1 Comment

Done that, thanks, but I'd prefer to not change each page, to better track changes etc.
0

The best way is to test it as the root on the dev machine. In my opinion, the closer you dev environment, mimics the production environment less post roll-out issues you have with broken links.
If you dev machine is Windows server version that you can host it as root on a different port.
If you machine is Windows Xp you can use iisadmin.net to host IIS on different ports similiar to Windows Server.

http://iisadmin.codeplex.com/

Remember this is the non-answer so negative votes would be please avoided

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.