Copied to clipboard

Flag this post as spam?

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

  • Billy 53 posts 244 karma points c-trib
    Mar 09, 2022 @ 09:45

    Local multi website setup IIS

    Hi, I'm using Umbraco v8.17.0

    For local development/debugging I normally use Visual Studio with IIS Express. This is perfect for a single website.

    Now I need to create a multiple site Umbraco installation.

    Trying to get this set up in IIS is giving me issues. Setup looks like this:

      - Application pool: umbracoApplicationPool
      - Site: umbracoSite
        - Bindings: umbracosite1.local:80 & umbracosite2.local:80

    My project builds and works when debugging with IIS Express in Visual Studio. But this way I can only test 1 website.

    Both IIS url's are working, but I'm getting the following error:

    Boot failed: Umbraco cannot run. See Umbraco's log file for more details. -> Umbraco.Core.Exceptions.BootFailedException: A connection string is configured but Umbraco could not connect to the database. bij Umbraco.Core.RuntimeState.DetermineRuntimeLevel(IUmbracoDatabaseFactory databaseFactory) in D:\a\1\s\src\Umbraco.Core\RuntimeState.cs:regel 188 bij Umbraco.Core.Runtime.CoreRuntime.DetermineRuntimeLevel(IUmbracoDatabaseFactory databaseFactory, IProfilingLogger profilingLogger) in D:\a\1\s\src\Umbraco.Core\Runtime\CoreRuntime.cs:regel 498 bij Umbraco.Core.Runtime.CoreRuntime.Boot(IRegister register, DisposableTimer timer) in D:\a\1\s\src\Umbraco.Core\Runtime\CoreRuntime.cs:regel 186

    In the logs:

    {"@t":"2022-03-09T09:42:24.3289287Z","@mt":"Error while acquiring","@l":"Error","@x":"System.Exception: Cannot connect to the database.\r\n bij Umbraco.Core.Persistence.UmbracoDatabaseFactory.Initialize() in D:\a\1\s\src\Umbraco.Core\Persistence\UmbracoDatabaseFactory.cs:regel 228\r\n bij System.Threading.LazyInitializer.EnsureInitializedCore[T](T& target, Boolean& initialized, Object& syncLock, Func`1 valueFactory)\r\n bij Umbraco.Core.Persistence.UmbracoDatabaseFactory.EnsureInitialized() in D:\a\1\s\src\Umbraco.Core\Persistence\UmbracoDatabaseFactory.cs:regel 210\r\n bij Umbraco.Core.Runtime.SqlMainDomLock.

    The web.config already contains following setting:

    <add key="Umbraco.Core.MainDom.Lock" value="SqlMainDomLock" />

    Any help on this issue? Thanks!

  • Damian 65 posts 388 karma points
    Mar 10, 2022 @ 15:40

    This error message says you need to confirm your connection string. The SqlMainDomLock is more of a load balancing concern, -it's certainly not the culprit here.

    I'd recommend opening up SQL Management Studio and trying the credentials from your connection string directly. This will let you rule out a miscopy or similar credential error in your connectionstring which is usually the case with this error.

    Re-Reading your post also suggests that you might have two different sites configured in IIS and that will be problematic if so - There should be only one IIS site but this site can have multiple url bindings; one for each of your domains in your Umbraco multi-site.

    -hope this helps!

  • Billy 53 posts 244 karma points c-trib
    Mar 11, 2022 @ 06:51

    In the end I stepped away from IIS and sticked with IIS Express. It is also possible there to configure more bindings for the application.

  • Tobias 14 posts 86 karma points
    Aug 18, 2023 @ 13:07

    How did you configure your bindings for IIS Express on a multisite? Would be great if you could share your solution

  • Billy 53 posts 244 karma points c-trib
    Aug 22, 2023 @ 05:16

    You need to add bindings in applicationhosts.config file.

    <site name="Kratos.Umbraco.Base.WebApp" id="2">
    <application path="/" applicationPool="Clr4IntegratedAppPool">
        <virtualDirectory path="/" physicalPath="C:\UmbracoWebsite" />
        <binding protocol="https" bindingInformation="*:44394:localhost" />
        <binding protocol="http" bindingInformation="*:18901:localhost" />
        <binding protocol="https" bindingInformation="*:443:sub1.custom-binding.local" />
        <binding protocol="https" bindingInformation="*:443:sub2.custom-binding.local" />

    The 2 localhosts bindings should already be there. Just add the extra ones you want. Don't forget to add these to you hosts.config also.

Please Sign in or register to post replies

Write your reply to: