There must be at least one site configured for the application to start


Hi all!!

I tried to deploy locally old episerver project (version 7.0) and I got a lot of errors.

At first, It was error: "Object reference not set to an instance of an object". And it is very strange because I have config files from project which is working now.

I found that I need to add next row in web.config

And now I have an error : "There must be at least one site configured for the application to start. "

Does anyone know how to fix this?

Sep 26, 2016 14:36

I think you can find the answer here:

Sep 26, 2016 14:46

I saw this public,but I think, that my configs are correct:


    <siteHosts siteId="test">
      <add name="*" />
      <add name="test.local" />
    <add key="/LM/W3SVC/2/ROOT:CPH-DEV-ARUT" siteId="test" />
    <site siteId="test" description="Example Site">
      <siteSettings httpCacheability="Public" httpCacheVaryByCustom="path" httpCacheVaryByParams="id,epslanguage" pageFolderVirtualPathProvider="SitePageFiles" pageRootId="1" pageStartId="0" pageValidateTemplate="false" pageWastebasketId="2" globalBlockFolderId="3" siteBlockFolderId="3" uiShowGlobalizationUserInterface="true" urlRebaseKind="ToRootRelative" siteDisplayName="Site Display Name" siteUrl="http://test.local/" uiUrl="~/test/UI/CMS/" utilUrl="~/util/" />

Maybe database are stored some settings, which related with this problem?

Sep 26, 2016 15:03

This looks weird..


Need to set that to a matching startpage id > 0. What the id is depends on database...check on a working environment for that solution and db.

Edited, Sep 26, 2016 15:23

thise is default config file, which was generated with Episerver Deployment Center.

If the problem was in this property, then I had another error message.

Edited, Sep 26, 2016 15:33

Ok but you have an existing site with some content right? Or are you trying to start a project from scratch?

Sep 26, 2016 15:35

Yes, I have project with content.

I tried create empty site with Episerver Deployment Center and copy all exsisting files to empty site.

Edited, Sep 26, 2016 15:37

Maybe the problem in section "episerver.common", which I added into web.config.

Sep 26, 2016 15:44

If you are using a database that contains an existing site with a startpage you need to set that start page id attribute above to the correct id. 

Sep 26, 2016 16:05

You can Guess id by looking into tblWorkContent table.

Sep 26, 2016 18:56

As I understood a database intended for Episerver 7.5, because sp "[sp_FxDatabaseVersion]" returns the version "7000".

So updated all dlls in soulution from 7.0 to 7.5

And added section into web.config:

<section name="episerver.common" type="EPiServer.Common.Configuration.EPiServerCommonSection, EPiServer.Common.Configuration" />

I got en error

Object reference not set to an instance of an object.

[NullReferenceException: Object reference not set to an instance of an object.]
   EPiServer.Common.Data.QueryFactory.ConfigureNHibernate() +659
   EPiServer.Common.Data.QueryFactory..cctor() +50

[TypeInitializationException: The type initializer for 'EPiServer.Common.Data.QueryFactory' threw an exception.]
   EPiServer.Common.Data.<>c__DisplayClass3.<Initialize>b__1(Object , EventArgs ) +123

Why Episerver try to configure nhibernate configuration (method ConfigureNHibernate)??? Config file, which I have from working site, doesn't have any nhibernate section.

Sep 27, 2016 14:21
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.