possible bug in 3.8.0?

possible bug in 3.8.0?

Old forum URL: forums.lhotka.net/forums/t/8089.aspx


Nemisis posted on Friday, December 04, 2009

HI everyone, i have recently upgraded from 3.6.1 to 3.8.0 and on my dev server, i have the following error appearing.

Database name not found in config file (devserver)
   at Csla.Data.ConnectionManager`1.GetManager(String database, Boolean isDatabaseName, String label)
   at Csla.Data.ConnectionManager`1.GetManager(String database, Boolean isDatabaseName)
   at Csla.Data.ConnectionManager`1.GetManager(String database)
   at BSL.Library.Scoring.ScorecardList.DataPortal_Fetch(AutoCompleteCriteria criteria)
   at dm(Object , Object[] )
   at Csla.Reflection.MethodCaller.CallMethod(Object obj, DynamicMethodHandle methodHandle, Object[] parameters)

The connectionstrings are kept in my app config file, and this error doesnt happen on my live server.  Has anyone else had this problem?

William.Hullsiek replied on Friday, December 04, 2009

I started encountering an error yesterday with a custom ContextManager for LinqToSql.  (Database name not found in config file in a call to my .GetManager method).   It only fires when in Visual Studio 2008.  I suspect this is more of a VS2008 problem than CSLA.net but I am still learning the framework.  

RockfordLhotka replied on Friday, December 04, 2009

I think there was a change in the GetManager() method's parameters - maybe between 3.6 and 3.8, certainly between 3.5 and 3.8.

Originally GetManager() just took the connection string. But it was later changed to take the database name and it looks up the connection string (by default). You have to pass false for the second parameter if you want it to use the parameter as a connection string directly.

Nemisis replied on Friday, December 04, 2009

Rocky,
Sorry if i am sounding stupid, but we used to pass in the name of the connectionstring, not the database name, is this what you mean?  My connectionstrings are kept in my web.config.

Example
<connectionStrings>
<add name="devstring" connectstring="..." />
</connectionstrings>

I want to pass in the word "devstring" such as
.GetManager("devstring")....

Do i need to pass in the extra parameter still?

Also i dont know why this is happening on one server and not the other, both are running windows server 2003.  My laptop doesnt produce the error and i am running Windows 7 with VS 2008.

I did notice that 3.8.0 needs mvc, should i install that on the servers as well?

RockfordLhotka replied on Friday, December 04, 2009

Then I don't have any idea, sorry...

No, you don't need to install MVC anywhere except your dev workstation. And 3.8.1 eliminates that requirement as well (which is the only reason 3.8.1 exists actually).

Copyright (c) Marimer LLC