Print Page | Close Window

EntityServerException

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=1734
Printed Date: 27-May-2024 at 4:14am


Topic: EntityServerException
Posted By: cjohnson84
Subject: EntityServerException
Date Posted: 21-Apr-2010 at 5:40am
I am in the process of trying to update my application to use the DevForce 2010.  I am getting the following error in the callback routine from a call to ExecuteAsync
 
Key 'CMISENTITIES': Parameter 'connectionString' is not valid. String arguments cannot be empty.
Parameter name: connectionString Check that either a connectionStrings element or EdmKey is defined for this key in the configuration file, or implement a custom IDataSourceKeyResolver.
 
I'm assuming this means there is no connection string definition in my web.config file.  Previously the connectionstring was added automatically to the edmKey section of the web.config file as follows:
 
<edmKeys>

<edmKey name="Default" connection="metadata=res://OrianaHouse.CMIS.Data.DataModel.CMISModelEF/CMISModel.csdl|res://OrianaHouse.CMIS.Data.DataModel.CMISModelEF/CMISModel.ssdl|res://OrianaHouse.CMIS.Data.DataModel.CMISModelEF/CMISModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=UDSSRV1\UDSLAB1;Initial Catalog=CMIS;Persist Security Info=True;User ID=xxxxx;Password=xxxxx;MultipleActiveResultSets=True&quot;" containerName="OrianaHouse.CMIS.Data.DataModel.CMISEntities">

<probeAssemblyNames>

<probeAssemblyName name="OrianaHouse.CMIS.Data.DataModel.CMISModelDF"/>

<probeAssemblyName name="OrianaHouse.CMIS.Data.DataModel.CMISModelEF"/>

</probeAssemblyNames>

</edmKey>

</edmKeys>

How do I get this to automatically occur now or is this something I now need to do manually?



Replies:
Posted By: cjohnson84
Date Posted: 21-Apr-2010 at 6:00am
As a follow-up I've been doing some further investigation.  I have my database model in a separate assembly and so the connection string is placed in the App.Config file of that assembly.
Do I now need to copy that into the Web.Config file of my web project or shouldn't DevForce be able to find it in the separate assembly App.Config?


Posted By: kimj
Date Posted: 21-Apr-2010 at 10:06am
You'll need either an EdmKey or a <connectionStrings> entry for, in this case, 'CMISENTITIES' in your web.config.   So yes, you will need to copy the connection string from the app.config in your model project.
 
Unlike DF2009, DF2010 will not update config files from the model project at design/build time. 
 
At runtime only a single config file is used, in this case the web.config, so the information there must be correct.  (The app.config from your model project is not automatically copied along with the assembly during build.)  In non-ASP.NET/SL applications you can point DevForce to the config file to use by setting either the IdeaBladeConfig.ConfigFileLocation or IdeaBladeConfig.ConfigFileAssembly statics, but generally it's much more straightforward to have the ideablade.configuration in the same single config recognized by .NET as the application's configuration file.



Print Page | Close Window