Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • erudit 13 posts 83 karma points
    Mar 19, 2017 @ 20:44
    erudit
    0

    Opening Umbraco site from Visual Studio and from a browser

    Hello!

    I am new to Umbraco and IIS.

    I have just installed the latest Umbraco (7.5.x) using NuGet from within Visual Studio (also created a database in the SQL Server and a Site in the IIS Manager).

    When I press F5 (Start Debugging) button in Visual Studio, my Umbraco site is successfully opened in the browser and as long as I am in the Debug mode in Visual Studio, I can open a new page and navigate to my URL 'http://localhost:#####' and everything works fine. BUT, as soon as I am exiting the Debug mode or close Visual Studio and manually open the browser and enter the same URL 'http://localhost:#####', then the page cannot be open anymore.

    Do you have any idea on how to solve it?

    Thank you in advance!

  • Alex Skrypnyk 6132 posts 23951 karma points MVP 7x admin c-trib
    Mar 19, 2017 @ 22:27
    Alex Skrypnyk
    0

    Hello Erudit

    When you press F5 in Visual Studio you open website in IIS Express, when you exit from debug it close down. So it works as all asp.net web-sites. Do you want to have possibility to open your web-site without running debug mode? Try to look how to do it - https://support.microsoft.com/en-us/help/323972/how-to-set-up-your-first-iis-web-site

    Thanks,

    Alex

  • erudit 13 posts 83 karma points
    Mar 20, 2017 @ 06:52
    erudit
    0

    Hi Alex!

    Thank you for your quick response!

    However, I did actually create the site in IIS (I wrote it in the beginning of the initial post).

    Here is what I did:

    1) Went to IIS Manager, Sites, right click and chosen 'Add Website' and create a new site 'MyUmbracoCMS'.

    enter image description here

    2) In the Physical path field I have specified a path to the Visual studio project with Umbraco installed (..\Documents\Visual Studio 2015\Projects\MyUmbracoCMS\MyUmbracoCMS), left the standard port 80 and IP address setting set to 'All Unassigned' and in the Host name field I wrote 'myumbraco.com'.

    enter image description here

    enter image description here

    3) Then I gave 'Modify' rights to the Visual Studio folder where the web site is referring to for users IUSR and IIS_IUSRS enter image description here

    4) Then I went to C:\Windows\System32\drivers\etc, opened the file Hosts and added a line: 127.0.0.1 myumbraco.com. enter image description here

    6) Now if I go back to the IIS Manager and choose 'Browse myumbraco.com on *:80 (http)', then I am getting an empty page, but I would expect to see my Umbraco site.

    enter image description here

    Note, it is not an error, it is just an empty page!

    enter image description here

    5) My Visual Studio Project setup has Web settings set to 'IIS Express' and Project URL to http://localhost:50821/ enter image description here and if I am trying to change it to 'Local IIS' and to specify my new URL 'myumbraco.com', then I am getting a warning and if I choose 'Yes', then an error:

    enter image description here enter image description here

    So, my questions are still open:

    • Why is my IIS setup not allowing me to see the Umbraco site when I am typing 'myumbraco.com' in the browser?

    • Why is Visual Studio giving me an error when I am trying to specify the 'Local IIS' and my local URL 'myumbraco.com'?

    Any feedback highly appreciated!

  • Richard Eyres 98 posts 580 karma points
    Mar 20, 2017 @ 08:22
    Richard Eyres
    0

    I am not certain why, but i do roughly the same process.

    What happens when you go to the Umbraco back office? Does it show a login screen? Are all your documents published?

    Check the logs to see of they are providing any extra information. Might give a reason why your published pages are not showing.

  • erudit 13 posts 83 karma points
    Mar 20, 2017 @ 10:42
    erudit
    0

    As long as I am in the Debugging mode in Visual Studio, I can go to Umbraco site or the back office and everything is shown correctly. BUT, as soon as I exit the Debugging mode, the sites are not accessible any more, see the screen shots below.

    enter image description here

    enter image description here

  • Richard Eyres 98 posts 580 karma points
    Mar 20, 2017 @ 11:05
    Richard Eyres
    0

    As far as i know, once debugging has stopped, the IIS Express will stop. You could run it via ctl F5 (which runs the site not in debug mode), but this has nothing to do with the IIS setup.

    As you have already mentioned, you have set up IIS with myumbraco.com, so you will need to use that and not localhost.

    Of course, my Knowledge in this matter is not very good, and i can only go on my experience. IIS Express in VS is not IIS on your machine (i am sure they could be related, but thats beyond my knowledge).

  • Kevin Jump 2310 posts 14695 karma points MVP 7x c-trib
    Mar 20, 2017 @ 11:25
    Kevin Jump
    0

    Hi

    With Visual Studio 2015 - you should be able to right click on the web project and choose view in web broswer (if it's a website)

    enter image description here

    or

    view -> View In Web Browser (if it's a web app) enter image description here

    In Visual Studio 2017 this option is avalible if you right click on the views folder.

    both options will start iisexpress (just like in debug) but not debugging. the site will run (and reload) as you continue to edit in visual studio - it will only stop if you exit visual studio, or close the site from the iis express icon in the taskbar.

  • Alex Skrypnyk 6132 posts 23951 karma points MVP 7x admin c-trib
    Mar 20, 2017 @ 10:46
    Alex Skrypnyk
    0

    Hi Erudit

    Try to add 'myumbraco.com' domain to Umbraco root node. As I see you don't have any content nodes yet, try to create first content node and assign 'myumbraco.com' domain to this node.

    Press right button on root node -> Culture and hostnames -> add 'myumbraco.com' domain

    Thanks,

    Alex

  • erudit 13 posts 83 karma points
    Mar 20, 2017 @ 10:56
    erudit
    0

    Alex, please, read my previous comment. I cannot even load the Umbraco site. I guess there is something wrong with the IIS setup.

  • Alex Skrypnyk 6132 posts 23951 karma points MVP 7x admin c-trib
    Mar 20, 2017 @ 11:07
    Alex Skrypnyk
    0

    Erudit, when you stop debugging IIS express is stopping, and your localhost site isn't working this is right functionality, you have to press F5 and debug each time or use IIS with 'myumbraco.com' domain.

  • Alex Skrypnyk 6132 posts 23951 karma points MVP 7x admin c-trib
    Mar 20, 2017 @ 10:57
    Alex Skrypnyk
    0

    My answer was to this question - Why is my IIS setup not allowing me to see the Umbraco site when I am typing 'myumbraco.com' in the browser?

  • erudit 13 posts 83 karma points
    Mar 20, 2017 @ 11:31
    erudit
    0

    Thank you Alex, Richard and Kevin for your replies.

    I understand from you answers that it is working as expected from within Visual Studio and I could just use that.

    However, I would still like to set it up on the IIS and be able to access Umbraco site via URL 'myubmraco.com' and wondering why it is not working there.

  • Alex Skrypnyk 6132 posts 23951 karma points MVP 7x admin c-trib
    Mar 20, 2017 @ 14:14
    Alex Skrypnyk
    0

    Erudit, try to add content node and add your domain to Umbraco Domains and Cultures.

  • erudit 13 posts 83 karma points
    Mar 20, 2017 @ 14:23
    erudit
    0

    I did and it didn't help.

  • Domenic 42 posts 128 karma points
    Mar 20, 2017 @ 14:38
    Domenic
    0

    Seems like something is up with your mapping in IIS. Try using http:// as a prefix or use 'localhost'

  • Michal 1 post 71 karma points
    Dec 19, 2018 @ 04:53
    Michal
    0

    Try to open Visual Studio as administrator.

  • Sebastiaan Janssen 5045 posts 15476 karma points MVP admin hq
    Dec 19, 2018 @ 08:30
    Sebastiaan Janssen
    0

    @Michal you don't need to run as admin at all when working with Umbraco.

    The way to do this is:

    • Search Visual Studio settings for continue
    • Do not "Enable Edit and Continue":
    • enter image description here
    • Search again, for browser
    • Disable: "Stop debugger when browser window is closed"
    • enter image description here
    • Search again, for javascript
    • Disable all three options if available: javascript debugging, edge dev tools and experimental way to launch Chrome
    • enter image description here
    • Extra tip: if Browser Link is enabled, make sure to disable it, it produces weird results a lot:
    • enter image description here
  • Bobi 346 posts 950 karma points
    Feb 29, 2020 @ 20:19
    Bobi
    0

    Sebastiaan, do you recommend setting up the development of Umbraco in IIS express as detailed by the poster, erudit, by opening IIS express and creating a new website rather than just using Visual Studio's function to serve via IIS express? Does it make it easier to deploy the website to a remote IIS server? OR do you recommend using web deploy within VS to publish to a server running IIS Express and not worry about the localhost IIS Express website setup?

Please Sign in or register to post replies

Write your reply to:

Draft