SQL CE 4.0 Compact edition not working in server

0 votes
asked Jul 29, 2015 in SQL Server by Raja

I have a windows service which is using SQL CE 4.0 compact edition database to stores some small information. I have tested the code in local and and the windows service is running successfully. But when I deployed the code in server , the windows service installed successfully but not started. It stopped and displayed the below error

The "MyService" service on Local Computer started and then stopped. Some services stop automatically if they are not in use by other services or programs.

So, when I looked in to the event viewer, I am seeing the following exception. What is the reason. How do I resolve this exception

Service cannot be started. System.TypeInitializationException: The type initializer for 'MyRepository' threw an exception. ---> Microsoft.Practices.ServiceLocation.ActivationException: Activation error occured while trying to get instance of type Database, key "LocalDbContext" ---> Microsoft.Practices.Unity.ResolutionFailedException: Resolution of the dependency failed, type = "Microsoft.Practices.EnterpriseLibrary.Data.Database", name = "LocalDbContext".
Exception occurred while: while resolving.
Exception is: InvalidOperationException - The type Database cannot be constructed. You must configure the container to supply this value.
-----------------------------------------------
At the time of the exception, the container was:

  Resolving Microsoft.Practices.EnterpriseLibrary.Data.Database,LocalDbContext
 ---> System.InvalidOperationException: The type Database cannot be constructed. You must configure the container to supply this value.
 ...
Share

Your answer

Preview

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.
site design / logo / content © 2013 - 2015 pinfaq.com
...