This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I'm trying to create a new service that uses LightSpeed. The new project is a service helper type of application for a web service which is already in production and works fine. I'm getting the above-named exception on the first attempt to call CreateUnitOfWork(). I suspect it is related to configuration. While I'm going from a web app to a service app, I was able to figure out what should be in my app.config (I think). For reference I've pasted it here. The code attempts to create LightSpeedContext with the name "default", which should match the config file below. Is there any way I can dig into what is specifically going wrong during construction?
<?xml version="1.0"?> <configuration> <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup> <configSections> <section name="lightSpeedContexts" type="Mindscape.LightSpeed.Configuration.LightSpeedConfigurationSection, Mindscape.LightSpeed"/> </configSections> <lightSpeedContexts> <add name="default" connectionStringName="Dev" dataProvider="SqlServer2005" identityMethod="IdentityColumn"/> </lightSpeedContexts> <connectionStrings> <add name="Dev" connectionString="server=localhost\INSTANCENAME;database=uPick;Integrated Security=SSPI" /> </connectionStrings> </configuration> |
|
|
The InnerException of the type initialisation exception should give you more details about the actual cause of the problem. (Your configuration looks okay to me.) |
|
|
Thanks for your reply. I'm getting: Configuration system failed to initialize.
The stack trace is:
System.Configuration.ConfigurationManager.PrepareConfigSystem() at System.Configuration.ConfigurationManager.GetSection(String sectionName) at Mindscape.LightSpeed.Configuration.LightSpeedConfigurationSection.Read() at Mindscape.LightSpeed.LightSpeedContext..ctor(String configurationName) at Mindscape.LightSpeed.LightSpeedContext`1..ctor(String configurationName)
That seems to be a configuration problem, but like you, I see nothing wrong with my app.config. Any further things to try are really welcomed.
Wes
|
|
|
Is there an InnerException to the ConfigurationErrorsException? (You may need to drill down more than one level.) Also check the ConfigurationErrorsException.Errors collection and .Line properties. Also, could you try changing your context name from "default" to something else, e.g. "Dev"? It *shouldn't* make any difference, but there is some code in LightSpeed which gives special treatment to that name (that code *shouldn't* be being called in your scenario but just to be sure!). |
|
|
Your suggestions led me to the ultimate solution. In my config I had configSections SECOND in the file. Evidently, that's a no-no. Changing that cleared this issue, now I can move on to other broken things. :)
Thanks!
Wes |
|