Click here to Skip to main content
15,886,689 members
Home / Discussions / C#
   

C#

 
GeneralRe: Protected Interface Members Pin
Ambika Jadhav4-Nov-12 16:09
Ambika Jadhav4-Nov-12 16:09 
QuestionWhy does this code hang? (async) Pin
SledgeHammer011-Nov-12 19:07
SledgeHammer011-Nov-12 19:07 
AnswerRe: Why does this code hang? (async) Pin
OriginalGriff1-Nov-12 22:24
mveOriginalGriff1-Nov-12 22:24 
GeneralRe: Why does this code hang? (async) Pin
SledgeHammer012-Nov-12 6:40
SledgeHammer012-Nov-12 6:40 
AnswerRe: Why does this code hang? (async) Pin
Eddy Vluggen2-Nov-12 2:00
professionalEddy Vluggen2-Nov-12 2:00 
QuestionWCF Windows Service with ASP.net Application authentication problem... Pin
JD861-Nov-12 11:37
JD861-Nov-12 11:37 
AnswerRe: WCF Windows Service with ASP.net Application authentication problem... Pin
JD861-Nov-12 11:48
JD861-Nov-12 11:48 
QuestionService Installer not generating the service exe file Pin
JD861-Nov-12 5:10
JD861-Nov-12 5:10 
I'm having a little trouble. I'm playing with WCF and trying to install it via a service. I'm following these two articles that I found: http://msdn.microsoft.com/en-us/library/ms733069.aspx[^] and http://a1ashiish-csharp.blogspot.com/2012/02/cnet-how-to-host-wcf-web-service-in.html#.UJGjIMXA_08[^]

Now what is happening is I created my WCF DLL Library and I added the WindowsService file and the ProjectInstaller to it. I then created a Windows Setup and added the primary output to the setup project.

When it installs it creates the service and links it to my DLL file instead of the windows service created a EXE and linking it to that. So what I end up with is a service that is unable to start because it can't use the DLL file.

Here is my ProjectInstaller class:
C#
[RunInstaller(true)]
public partial class ProjectInstaller : System.Configuration.Install.Installer
{
    public ProjectInstaller()
    {
        this.AfterInstall += new System.Configuration.Install.InstallEventHandler(ProjectInstaller_AfterInstall);

        InitializeComponent();
    }

    void ProjectInstaller_AfterInstall(object sender, System.Configuration.Install.InstallEventArgs e)
    {
        using (ServiceController sc = new ServiceController("HostingPanelDC"))
        {
            try
            {
                sc.Start();
            }
            catch (Exception ex)
            {
                EventLog.WriteEntry("HostingPanel", "Unable to start service. Error: " + ex.Message, EventLogEntryType.Error);
            }
        }
    }
}


I set the service name and all the service info by clicking serviceInstaller1 and serviceProcessInstaller1 and editing the fields in the properties page.


Here is my windows service class:

C#
partial class WindowsService : ServiceBase
{
    public ServiceHost serviceHost = null;

    public WindowsService()
    {
        InitializeComponent();

        ServiceName = "HostingPanelDC";
    }

    public static void Main()
    {
        ServiceBase.Run(new WindowsService());
    }

    protected override void OnStart(string[] args)
    {
        if (serviceHost != null)
            serviceHost.Close();

        serviceHost = new ServiceHost(typeof(DC.DomainController));
        serviceHost.Open();
    }

    protected override void OnStop()
    {
        if (serviceHost != null)
        {
            serviceHost.Close();
            serviceHost = null;
        }
    }
}


What exactly am I missing that is causing this not to generate the exe file? Thank in advanced!
AnswerRe: Service Installer not generating the service exe file Pin
JD861-Nov-12 5:18
JD861-Nov-12 5:18 
AnswerRe: Service Installer not generating the service exe file Pin
CafedeJamaica1-Nov-12 11:05
professionalCafedeJamaica1-Nov-12 11:05 
GeneralRe: Service Installer not generating the service exe file Pin
JD861-Nov-12 11:13
JD861-Nov-12 11:13 
QuestionBackup/Restore - SQL Compact Edition Pin
saturnuk31-Oct-12 22:47
saturnuk31-Oct-12 22:47 
AnswerRe: Backup/Restore - SQL Compact Edition Pin
Richard MacCutchan31-Oct-12 23:48
mveRichard MacCutchan31-Oct-12 23:48 
AnswerRe: Backup/Restore - SQL Compact Edition Pin
Simon_Whale1-Nov-12 0:47
Simon_Whale1-Nov-12 0:47 
GeneralRe: Backup/Restore - SQL Compact Edition Pin
saturnuk1-Nov-12 0:58
saturnuk1-Nov-12 0:58 
GeneralRe: Backup/Restore - SQL Compact Edition Pin
Eddy Vluggen1-Nov-12 1:55
professionalEddy Vluggen1-Nov-12 1:55 
GeneralRe: Backup/Restore - SQL Compact Edition Pin
GrooverFromHolland2-Nov-12 10:46
GrooverFromHolland2-Nov-12 10:46 
QuestionInfragistics Tree With Checkboxes Pin
Kevin Marois31-Oct-12 12:49
professionalKevin Marois31-Oct-12 12:49 
AnswerRe: Infragistics Tree With Checkboxes Pin
Pete O'Hanlon31-Oct-12 13:26
mvePete O'Hanlon31-Oct-12 13:26 
GeneralRe: Infragistics Tree With Checkboxes Pin
Kevin Marois31-Oct-12 13:28
professionalKevin Marois31-Oct-12 13:28 
AnswerRe: Infragistics Tree With Checkboxes Pin
Mycroft Holmes31-Oct-12 16:29
professionalMycroft Holmes31-Oct-12 16:29 
GeneralRe: Infragistics Tree With Checkboxes Pin
Kevin Marois31-Oct-12 18:41
professionalKevin Marois31-Oct-12 18:41 
Question921600 Pin
C-P-User-331-Oct-12 12:47
C-P-User-331-Oct-12 12:47 
AnswerRe: 921600 Pin
Pete O'Hanlon31-Oct-12 13:24
mvePete O'Hanlon31-Oct-12 13:24 
GeneralRe: 921600 Pin
C-P-User-31-Nov-12 7:00
C-P-User-31-Nov-12 7:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.