The type or namespace 'Installer' does not exist in the class or namespace 'System.Configuration'

J

John Chrisman

I get the above error message as well as a complaint about the
RunInstallerAttribute not being found when compiling the following code.
This couldn't be any simpler and I see examples on the web that use this
namespace and this attribute. I am using VS.Net 2003. Any ideas?

using System;
using System.ServiceProcess;
using System.Configuration.Installer;

namespace POP3Retriever
{
[RunInstallerAttribute(true)]
public class ProjectInstaller : System.ServiceProcess.ServiceInstaller
{
public ProjectInstaller()
{
ServiceProcessInstaller spi = new ServiceProcessInstaller();
spi.Account = ServiceAccount.LocalSystem;
ServiceInstaller si = new ServiceInstaller();
si.ServiceName = "POP3 retriever";
si.StartType = ServiceStartMode.Manual;
Installers.AddRange(new Installer[] {spi, si});
}
}
}
 
J

John Chrisman

Sorry, here is the actual code. The previous version was from me trying to
get it to work. It actually complains that Install is not a type or
namespace in System.Configuration.

using System;
using System.ServiceProcess;
using System.Configuration.Install;

namespace POP3Retriever
{
[RunInstallerAttribute(true)]
public class ProjectInstaller : System.ServiceProcess.ServiceInstaller
{
public ProjectInstaller()
{
ServiceProcessInstaller spi = new ServiceProcessInstaller();
spi.Account = ServiceAccount.LocalSystem;
ServiceInstaller si = new ServiceInstaller();
si.ServiceName = "POP3 retriever";
si.StartType = ServiceStartMode.Manual;
Installers.AddRange(new Installer[] {spi, si});
}
}
}
 
J

John Chrisman

OK, solved it myself. It never fails that the minute I give up on something
and ask for help I realize the solution. This is the first time I've had to
add a reference to anything that is in the System namespace. I assumed
everything in the System namespace was already referenced.

John Chrisman said:
Sorry, here is the actual code. The previous version was from me trying to
get it to work. It actually complains that Install is not a type or
namespace in System.Configuration.

using System;
using System.ServiceProcess;
using System.Configuration.Install;

namespace POP3Retriever
{
[RunInstallerAttribute(true)]
public class ProjectInstaller : System.ServiceProcess.ServiceInstaller
{
public ProjectInstaller()
{
ServiceProcessInstaller spi = new ServiceProcessInstaller();
spi.Account = ServiceAccount.LocalSystem;
ServiceInstaller si = new ServiceInstaller();
si.ServiceName = "POP3 retriever";
si.StartType = ServiceStartMode.Manual;
Installers.AddRange(new Installer[] {spi, si});
}
}
}

John Chrisman said:
I get the above error message as well as a complaint about the
RunInstallerAttribute not being found when compiling the following code.
This couldn't be any simpler and I see examples on the web that use this
namespace and this attribute. I am using VS.Net 2003. Any ideas?

using System;
using System.ServiceProcess;
using System.Configuration.Installer;

namespace POP3Retriever
{
[RunInstallerAttribute(true)]
public class ProjectInstaller : System.ServiceProcess.ServiceInstaller
{
public ProjectInstaller()
{
ServiceProcessInstaller spi = new ServiceProcessInstaller();
spi.Account = ServiceAccount.LocalSystem;
ServiceInstaller si = new ServiceInstaller();
si.ServiceName = "POP3 retriever";
si.StartType = ServiceStartMode.Manual;
Installers.AddRange(new Installer[] {spi, si});
}
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top