cdburnett
Posts: 6
Joined: Thu Jan 17, 2013 9:43 pm

Why would installation method affect .NET service?

I have built a WCF service that is hosted in a Windows Service following this article: http://msdn.microsoft.com/en-us/library/ms733069.aspx. Part of what the code in the service does is join a multicast group and listen for data that is broadcast to the group. Then it processes it. I have found that when I install the service manually using InstallUtil it works fine. To install it manually I do the following:

- Build the MyService project in Visual Studio.
- Right click on the Visual Studio Command Prompt and choose Run As Administrator
- Navigate to the folder that has the MyService.exe file
- Run the InstallUtil command as follows: installutil.exe MyService.exe

The service installs in Windows fine and then I start it. Then I run my ASP.NET application which is the client for the service and it runs fine. The service receives and processes the data just fine.

However I am trying to use Advanced Installer to build an MSI or EXE that will install the service and the ASP.NET application all at once so it doesn't have to be done manually. I am able to successfully create the Advanced Installer project that does this and it actually installs both the ASP.NET application and the Windows Service just fine and it starts my Windows Service too. However the really strange thing is that when I run the application I find that my service code can not receive any multicast data. It seems to block on that line of code and I never get any data. Does anyone know why this would happen? I have tried using an EXE and using "Run As Administrator" when I do the Advanced Installer installation. Here is the code from my service.

Code: Select all

_groupAddress = IPAddress.Parse(_myIPAddress);
_listener = new UdpClient(_myPort);
_groupEP = new IPEndPoint(_groupAddress, _myPort);

_listener.JoinMulticastGroup(_groupAddress);
byte[] _bytes = _listener.Receive(ref _groupEP);
It seems to block on that last line of code and it never receives any data. This only happens when I install using Advanced Installer. When I install manually it works fine.
Bogdan
Posts: 2794
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Why would installation method affect .NET service?

Identical question debated on StackOverflow: http://stackoverflow.com/questions/1458 ... 0#14599310

Best regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
lokesh
Posts: 23
Joined: Tue Jul 31, 2012 11:45 am

Re: Why would installation method affect .NET service?

Hi cdburnett,
Same as like you , i created WCF service using Visual studio 2012,
Now i want to create MSI package for that WCF service using Advance installer.
I don't know how to create it..
Please provide me the basic and full steps for creating MSI package using Advance Installer.
Please guide me..


Regards,
Lokesh.J

Return to “Common Problems”