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

Vote:
 

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?

#158274
Sep 26, 2016 14:36
Vote:
 

I think you can find the answer here:

http://world.episerver.com/forum/developer-forum/EPiServer-Relate/Thread-Container/2011/6/There-must-be-at-least-one-site-configured-for-the-application-to-start/

#158275
Sep 26, 2016 14:46
Vote:
 

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

episerverFramework.config

<siteHostMapping>
    <siteHosts siteId="test">
      <add name="*" />
      <add name="test.local" />
    </siteHosts>
  </siteHostMapping>
  <automaticSiteMapping>
    <add key="/LM/W3SVC/2/ROOT:CPH-DEV-ARUT" siteId="test" />
  </automaticSiteMapping>
<sites>
    <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/" />
    </site>
  </sites>

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

#158276
Sep 26, 2016 15:03
Vote:
 

This looks weird..

pageStartId="0"

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.

#158279
Edited, Sep 26, 2016 15:23
Vote:
 
pageStartId="0"

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.

#158280
Edited, Sep 26, 2016 15:33
Vote:
 

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

#158283
Sep 26, 2016 15:35
Vote:
 

Yes, I have project with content.

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

#158285
Edited, Sep 26, 2016 15:37
Vote:
 

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

#158287
Sep 26, 2016 15:44
Vote:
 

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. 

#158288
Sep 26, 2016 16:05
Vote:
 

You can Guess id by looking into tblWorkContent table.

#158293
Sep 26, 2016 18:56
Vote:
 

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.

#158322
Sep 27, 2016 14:21
This thread is locked and should be used for reference only.
* 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.