M
mma
hello everyone,
i have a solution that contains the following project types:
1. Class library
contains a singleton class that handles the data access (sql
server 2005).
2. Windows service.
uses the Class library's singleton class to manipulate data in
the data base server.
3. Windows application.
used for debuging the Class library's singleton class.
* I'm developing in VS2005 using c#.
The problem is:
When i try to get the singleton class's static instance from the
context of the windows service
i get an exeption.
the message is:
Service cannot be started.
System.Configuration.ConfigurationErrorsException:
The requested database myGovAlerts is not defined in configuration.
at
Microsoft.Practices.EnterpriseLibrary.Data.DatabaseConfigurationView.ValidateConnectionStringSettings
(String name, ConnectionStringSettings connectionStringSettings)
at
Microsoft.Practices.EnterpriseLibrary.Data.DatabaseConfigurationView.GetConnectionStringSettings
(String name)
at
Microsoft.Practices.EnterpriseLibrary.Data.DatabaseCustomFactory.CreateObject
(IBuilderContext context, String name, IConfigurationSource
configurationSource, ConfigurationReflectionCache reflectionCache)
at
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.ConfiguredObjectStrategy.BuildUp
(IBuilderContext context, Type t, Object existing, String id)
at
Microsoft.Practices.ObjectBuilder.BuilderStrategy.BuildUp
(IBuilderContext context, Type typeToBuild, Object existing, String
idToBuild)
at
Microsoft.Practices.ObjectBuilder.SingletonStrategy.BuildUp
(IBuilderContext c...
--------------------------------------------------------------------------------------------------------
p.s When getting the singleton instance from the context of the windows
application it works
great.
--------------------------------------------------------------------------------------------------------
As i understand according to the line in the message:
"at
Microsoft.Practices.ObjectBuilder.SingletonStrategy.BuildUp
(IBuilderContext c..."
the singletone's instance builder expects an IBuilderContext object.
the context that is given is the windows service's and that is probably
the problem.
how can i solve it?
thanks.
i have a solution that contains the following project types:
1. Class library
contains a singleton class that handles the data access (sql
server 2005).
2. Windows service.
uses the Class library's singleton class to manipulate data in
the data base server.
3. Windows application.
used for debuging the Class library's singleton class.
* I'm developing in VS2005 using c#.
The problem is:
When i try to get the singleton class's static instance from the
context of the windows service
i get an exeption.
the message is:
Service cannot be started.
System.Configuration.ConfigurationErrorsException:
The requested database myGovAlerts is not defined in configuration.
at
Microsoft.Practices.EnterpriseLibrary.Data.DatabaseConfigurationView.ValidateConnectionStringSettings
(String name, ConnectionStringSettings connectionStringSettings)
at
Microsoft.Practices.EnterpriseLibrary.Data.DatabaseConfigurationView.GetConnectionStringSettings
(String name)
at
Microsoft.Practices.EnterpriseLibrary.Data.DatabaseCustomFactory.CreateObject
(IBuilderContext context, String name, IConfigurationSource
configurationSource, ConfigurationReflectionCache reflectionCache)
at
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.ConfiguredObjectStrategy.BuildUp
(IBuilderContext context, Type t, Object existing, String id)
at
Microsoft.Practices.ObjectBuilder.BuilderStrategy.BuildUp
(IBuilderContext context, Type typeToBuild, Object existing, String
idToBuild)
at
Microsoft.Practices.ObjectBuilder.SingletonStrategy.BuildUp
(IBuilderContext c...
--------------------------------------------------------------------------------------------------------
p.s When getting the singleton instance from the context of the windows
application it works
great.
--------------------------------------------------------------------------------------------------------
As i understand according to the line in the message:
"at
Microsoft.Practices.ObjectBuilder.SingletonStrategy.BuildUp
(IBuilderContext c..."
the singletone's instance builder expects an IBuilderContext object.
the context that is given is the windows service's and that is probably
the problem.
how can i solve it?
thanks.