Configuration Manager

djsway3
NewLounger
Posts: 3
Joined: 08 Jun 2011, 17:58

Configuration Manager

Post by djsway3 »

When building a service in C# in visual studio 2010, is there anyway to get around the following error? Normally it is because the lack of an assembly reference(using System.Configuration). In this case it is because it is an application where a service is to be installed. The class is partial class Service1 : ServiceBase. Error: The name configuration manager does not exist in this context

User avatar
HansV
Administrator
Posts: 78568
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Configuration Manager

Post by HansV »

Welcome to Eileen's Lounge!

Right-click the project and select Add Reference... from the context menu.
In the .NET tab, find and select the "System.Configuration" component name and click OK.
Best wishes,
Hans

djsway3
NewLounger
Posts: 3
Joined: 08 Jun 2011, 17:58

Re: Configuration Manager

Post by djsway3 »

Thank you, that fixed the error. When I right-click the setup project to install the service, the feature is not available, do you know why this is? I have a primary output there which is active.

User avatar
HansV
Administrator
Posts: 78568
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Configuration Manager

Post by HansV »

I'm sorry, I don't know anything about C#, I found my previous reply by Googling...
Best wishes,
Hans

djsway3
NewLounger
Posts: 3
Joined: 08 Jun 2011, 17:58

Re: Configuration Manager

Post by djsway3 »

I was able to install the service using this website: Walkthrough: Creating a Windows Service Application in the Component Designer.
After installing and starting the service I got the following Error 1053: The service did not respond to the start control request in a timely fashion.
Any ideas? Assuming a solution is found, does everything need to be rebuilt and reinstalled or just saved?
Last edited by HansV on 01 Jul 2011, 18:21, edited 1 time in total.
Reason: to correct non-working link

User avatar
HansV
Administrator
Posts: 78568
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Configuration Manager

Post by HansV »

Perhaps someone will come up with a suggestion, but don't hold your breath. We don't have many C# or .NET experts - the focus is more on VBA.
Best wishes,
Hans