November Happy Hour will be moved to Thursday December 5th.

Connection string 'CmoEntities' is not found

Vote:
 

 

Hi there, anyone has any idea about the below error? Thanks!

Server Error in '/' Application.


Connection string 'CmoEntities' is not found
Parameter name: name

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.ArgumentException: Connection string 'CmoEntities' is not found
Parameter name: name

Source Error: 

[No relevant source lines]


Source File: c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\7f2d109f\8499e8ac\App_global.asax.0.cs    Line: 

Stack Trace: 

[ArgumentException: Connection string 'CmoEntities' is not found
Parameter name: name]
   EPiServer.Cmo.Core.Entities.CmoDataBase..ctor(String name) +377
   EPiServer.Cmo.Cms.CmoInitialization..ctor() +99

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
   System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +159
   System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +256
   System.Activator.CreateInstance(Type type, Boolean nonPublic) +127
   System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark) +14426381
   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +200
   System.Activator.CreateInstance(Type type, Object[] args) +38
   System.Linq.WhereSelectEnumerableIterator`2.MoveNext() +248
   System.Linq.<CastIterator>d__b1`1.MoveNext() +296
   System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +536
   System.Linq.Enumerable.ToList(IEnumerable`1 source) +80
   EPiServer.Framework.Initialization.InitializationEngine.Initialize(HostType hostType) +99
   EPiServer.Framework.Initialization.InitializationModule.Initialize(HostType hostType) +308
   EPiServer.Framework.Initialization.InitializationModule.FrameworkInitialization(HostType hostType) +93
   EPiServer.Global..ctor() +102
   EPiServer.Templates.Alloy.Global..ctor() +40
   ASP.global_asax..ctor() in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\7f2d109f\8499e8ac\App_global.asax.0.cs:0

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
   System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +159
   System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +256
   System.Activator.CreateInstance(Type type, Boolean nonPublic) +127
   System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark) +14426381
   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +200
   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture) +28
   System.Web.HttpRuntime.CreateNonPublicInstance(Type type, Object[] args) +83
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +312
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +475

[HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12880068
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12721257

 


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18033

#70020
Apr 11, 2013 8:30
Vote:
 

It looks like CMO database connection is not configured properly. Could you check that connection string named CmoEntities is defined in your website configuration?

By default connectionStrings.config file contains following connection string after installing EPiServer CMO:

<connectionStrings>
<add name="CmoEntities" connectionString="provider connection string=&quot;Data Source=YourDataServer;Initial Catalog=yourDatabase;Integrated Security=False;User ID=yourUser;Password=yourPassword;Connect Timeout=10&quot;;metadata=res://*/Entities.CmoModel.csdl|res://*/Entities.CmoModel.ssdl|res://*/Entities.CmoModel.msl;provider=System.Data.SqlClient" providerName="System.Data.EntityClient" />
</connectionStrings>

#70024
Edited, Apr 11, 2013 9:28
Vote:
 

Yes, maybe it is because of this problem. 

I tried to look for the "CmoEntities" in the Web.config file, but it was not found. 

 

So what should I do now? I did try to select all of items when I was installing those components from EPiServer Deployment Center. 

But why is that the CMO is still not installed? 

#70084
Apr 11, 2013 15:53
Vote:
 

You can run Deployment center and try to re-installl EPiServer CMO in that site.

By default CMO database connection string should be added in connectionStrings.config file. In the same file you have connection string for CMS database. Do you have anything in that file?

Can you describe steps to reproduce this issue?

#70085
Apr 11, 2013 16:01
Vote:
 

The below is the connectionStrings.config file in my Alloy project:  

What should i do then? 

 

<connectionStrings>
<clear/>
<add name="EPiServerDB" connectionString="Data Source=BEN-PC\SQLEXPRESS;Initial Catalog=dbAlloy;Integrated Security=False;User ID=dbUserAlloy;Password=@123456;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />
</connectionStrings>

#70088
Apr 11, 2013 16:04
Vote:
 

Ah, ok, now I see what could be a problem. Everytime when you rebuild Alloy templates project it generates website configuration files based on templates in [Configuration] folder.

So probably you installed CMO, then rebuilt the project and all CMO configuration was lost.

See following blog postss and documentation for more details:

Modules and Alloy Templates

Developers: Before You Build that Alloy 7 Project…

#70089
Apr 11, 2013 16:11
Vote:
 

Hi Dmytro, 

Thanks for your reply! That might be the problem. But I think I still got some problems to resolve my problem. 

Actually the reason why I want to build the project is because I want to create a block type and block template in the Alloy project. 

I was following the below link to create it 

http://world.episerver.com/Blogs/Alexander-Haneng/Dates/2012/8/How-to-create-a-simple-Block-Type-in-EPiServer-CMS-7/

I have created the MyBlock.cs and MyBlockTemplate.ascx in the project, but when I go to the admin mode of Alloy site, and the block I just created does show up in the Block Type ietms. So I thought I need to build the project to make it appear in the Block Type item. That is why I built the project. However once I build the project, I cannot even open the site anymore for some reason. 

Ben 

#70110
Apr 12, 2013 3:17
Vote:
 

Sure, you have to build the project to get new content type. I would suggest to create new site, install everything what you need on that site and remove that build event in Alloy project that generates configuration files everytime you rebuild the project. In this case any changes in configuration won't be overriden.

#70135
Apr 12, 2013 12:22
Vote:
 

Ok. I am doing that now. 

What do you mean "remove that build event in Alloy project that generates configuration files everytime ou rebuild the project" ? 

Can I have more detail about this? 

Thank you very much for your help , Dmytro!

#70136
Apr 12, 2013 12:38
Vote:
 

See following blog postss and documentation for more details:

Modules and Alloy Templates

Developers: Before You Build that Alloy 7 Project…

#70137
Apr 12, 2013 12:40
Vote:
 

I have refer to the link : http://world.episerver.com/Blogs/Jeff-Wallace/Dates/2012/11/Developers-Before-You-Build-that-Alloy-7-Project/

and http://world.episerver.com/Documentation/Items/Installation-Instructions/Installation-Instructions---EPiServer-7/Modules-and-Alloy-Templates-Configuration/

and I have done the following steps one by one

1. Install the integrated Alloy site with all the compulsory modules(e.g. CMO, Database etc) by running EPiServer Deployment Center and choosing the right option.

2. After this step, the site can be open by entering http://localhost:17000, it is definitely working  

2. Copy the <YourSiteRoot>\[Configuration]\EPiServer folder and put it in the root folder.

3. Build the Alloy project from Visual studio

4. Copy the EPiServer folder under the root folder back to the  <YourSiteRoot>\[Configuration]. 

 

Now I still cannot run the site because the CMO is also gone.

Was I misunderstand anything about those steps before first build of Alloy site?

 

#70230
Apr 16, 2013 6:21
Vote:
 

Hi Ben,

There are two scenarios in this article: http://world.episerver.com/Documentation/Items/Installation-Instructions/Installation-Instructions---EPiServer-7/Modules-and-Alloy-Templates-Configuration/ for a new site and for a site with Alloy Templates already installed.

In your case, as I understand, you are trying to install a new site. So you should do installation in a certain sequence:

1. Install an empty EPiServer CMS site. (It means no Alloy, no CMO just an empty site. No optional modules should be choosen in the Deployment Center, except Search)

2. Install all required modules (CMO is installed on this step)

3. Install the Alloy Templates (the Alloy is installed the last)

If you do the installation according to these steps then you don't need to copy configuration files manually.

#70231
Apr 16, 2013 8:43
Vote:
 

Hi Sergii,

Thanks for replying. I am sure you have expained it very clearly now and I understand that totally. 

Now the thing is: which action should I choose from EPiServer Deployment Center in order to install a totally clean, empty, pure site without any module? I cannot see any option from it. 

I doubt that if I should choose "-> Install site without database?"  

 

I am using EPiServer 7. 

I think if I can get this step solved, then the rest should be no problem at all. This step confused me. 

Ben 

#70232
Apr 16, 2013 8:59
Vote:
 

In order to install an empty site you should:

  1. Choose "Install site and SQL server database" in the Deployment Center
  2. Configure required paramters on Step 1, Step 2 and Step 3 in the Deployment Cetner 
  3. Do not choose any modules on the Step 4
  4. Continute with Step 5 and Step 6

After that you will get an emtpy EPiServer site (with a database) that doesn't have any modules and no pages.

#70234
Apr 16, 2013 9:09
Vote:
 

Hi Sergii,

It is very clear now !

It is 100% working now! 

Thank you so much! 

Ben 

#70237
Apr 16, 2013 9:22
Vote:
 
More about connection string http://asp.net-informations.com/ado.net/asp-connection-string.htm Robert
#121428
May 11, 2015 7:50
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* 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.