locked
"View in Browser" always loads root level page instead of current page. RRS feed

  • Question

  • Hello,

    I have just built a new system at work and I have installed Visual Studio 2013 (Update 5) and I am having a strange issue with the "View in Browser" functionality.

    This happens on all of my current ASP.NET web application solutions, as well as if I create a new one. Any time I right click an asp page in the solution explorer, or even right clicking the file's code forward, and try to view in browser, the IIS Express server loads the Default.aspx page instead.

    These same projects work perfectly on my old system which has the same version of Visual Studio installed. This helps me know that the problem is most likely not the solution.

    Before I re-install Visual Studio 2013 on a fresh build, I was wondering of other things to try. Are there any settings hidden somewhere that would prevent the View in Browser option from working correctly?

    Thank you,

    Brian

    Friday, October 27, 2017 12:44 PM

Answers

  • I seem to have fixed it.

    Reinstalling Visual Studio 2013 did not work, so I uninstalled all versions of Visual Studio from my computer, as well as anything in the Programs & Features area that had the word "visual studio" in it. I then also uninstalled IIS Express.

    I started over, installing VS2005, then VS2008, then VS2010, then VS2013. I started to get errors about IIS Express not being able to launch. I then deleted the IISExpress folder in my userdata folder. After that, I reopened VS2013 and started debugging, and it now appears to work.

    Hopefully now when I install VS2017 and then VisualSVN I will not have the problem return.

    Thursday, November 2, 2017 12:23 PM

All replies

  • Hi Brian,

    Welcome to MSDN forum.

    Please restart visual studio and open or create a solution, right click on any asp page instead of the default page, then wait the result. If the issue persists, view the properties of the asp page check it if the URL has been changed to the default page like the following screenshot.

    If it has the correct URL in properties, you may need to reset visual studio settings. Please click Tools->Import and Export Settings->Reset All Settings. Besides, repair visual studio.

    Bets regards,

    Joyce


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, October 30, 2017 6:52 AM
  • Hello Joyce,

    I right click the page and it still loads to the root (localhost:54972) instead of the page when I "View In Browser."

    https : / / imgur.com / x67f1kc

    I checked the properties of the page, and the properties are fine. Like I said in my post, this same exact solution works perfectly on another system in the same version of Visual Studio.

    https : // imgur.com / O8Z68A7

    I then did as you suggested and reset all settings, and this has still not resolved my issue:

    https : // imgur.com / bCIjjpN

    Please advise what else could be wrong. Also, I cannot seem to post images or links even though I created this account 4 years ago.

    Thank you,

    Brian

    Monday, October 30, 2017 12:19 PM
  • Hi,

    Thank you for the update.

    Have you tried to repair visual studio via control panel?

    If you delete the default page in solution explorer, will the issue persists? 

    Please try to use another browser to test it again.

    Best regards,

    Joyce


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, October 31, 2017 9:53 AM
  • Hi,

    Thank you for the update.

    Have you tried to repair visual studio via control panel?

    If you delete the default page in solution explorer, will the issue persists? 

    Please try to use another browser to test it again.

    Best regards,

    Joyce


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact

    I performed a repair on Visual Studio 2013, and the problem persists.

    I deleted the default.aspx page, and when I try to "View in Browser" any other page, it still loads localhost:54972 but gives an error (because there is no default page):

    HTTP Error 403.14 - Forbidden

    The Web server is configured to not list the contents of this directory.

    The problem also persists in all browsers I've tested:

    Mozilla Firefox 

    Google Chrome

    Internet Explorer

    Tuesday, October 31, 2017 12:30 PM
  • Hi Brian,

    How is the <authentiation> tag like in your web.config?

    <authentication mode="Forms">
          <forms loginUrl="~/Account/Login.aspx" protection="All" timeout="30" path="/" defaultUrl="~/default.aspx" />
        </authentication>

    if default url set for forms authentication, it will always redirect to default.aspx page.

    Reference link:

    https://forums.asp.net/t/1848006.aspx?Page+in+folder+always+redirecting+to+default+aspx

    To your case, it looks a bit different, but i prefer testing it in my side if you may share us the necessary code or maybe the whole project would be better.

    does this issue happened to all of the projects you created? If so, it could be VS IDE its own problem, you could try to install it if the repair does not work.

    Your understanding and cooperation will be grateful.

     

    Best regards,

    Fletcher


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.



    • Edited by Fletch Zhou Wednesday, November 1, 2017 9:44 AM
    Wednesday, November 1, 2017 9:44 AM
  • Hi Fletcher,

    The authentication is set to Windows.

    The problem is not project/solution specific. This happens on new projects as well. 

    I re-installed Visual Studio 2013 and the problem still exists.

    One thing to note is that if I use Visual Studio 2017, it works just fine. However, I'd like to continue using Visual Studio 2013 for older projects that were created in 2013. The Visual Studio Version Selector will continue to prefer to open these solutions in 2013 anyway.

    At this point, what else can I do, now that re-installing VS2013 did not work?

    Thanks,

    Brian

    Wednesday, November 1, 2017 3:14 PM
  • Hi,

    Please provide the screenshots of the project property and the project, like the screenshot below:

    If possible, please copy a new default asp.net project to another visual studio to check if the issue persists. Or you could upload it to https://onedrive.live.com/ and share the link here, we can test it in our side.

    Besides, reset your browser and clean browser’s cache, disable any Anti-Virus or Anti-Spyware software on your computer to check it if the issue is related to computer environment.

    Best regards,

    Joyce


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, November 2, 2017 9:15 AM
  • I seem to have fixed it.

    Reinstalling Visual Studio 2013 did not work, so I uninstalled all versions of Visual Studio from my computer, as well as anything in the Programs & Features area that had the word "visual studio" in it. I then also uninstalled IIS Express.

    I started over, installing VS2005, then VS2008, then VS2010, then VS2013. I started to get errors about IIS Express not being able to launch. I then deleted the IISExpress folder in my userdata folder. After that, I reopened VS2013 and started debugging, and it now appears to work.

    Hopefully now when I install VS2017 and then VisualSVN I will not have the problem return.

    Thursday, November 2, 2017 12:23 PM
  • Hi,

    Thank you for the update.

    Glad to know that you have solved the issue by yourself and thank you for sharing the solution here, could you please mark your reply as an answer which will be helpful for those who has the similar issue with you?

    Best regards,

    Joyce


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, November 3, 2017 1:32 AM