Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Indigo

Getting an error when hosting in a windows service.

Update your Vista Drivers Update Your Drivers Now!!
 
 
Thread Tools Display Modes
Old 03-23-2007   #1 (permalink)
Kevin Burton
Guest


 

Getting an error when hosting in a windows service.

I get the following exception when I am starting (webservice.Open()) a WCF
service. I have put the same service in a console host and in an IIS host
with no problem. Any ideas what I can change to successfully host in a
service? Inside the OnStart method I change the directory from
C:\Windows\System32 to the installation directory so that the configuration
file can be found. I don't know if that is the source of my problem or not. I
change the directory using Environment.CurrentDirectory = path and I do this
before the service is Open. I assume that the configuration file will be used
on Open?

Kevin

1:11:10 PM - Exception
System.InvalidOperationException: Service x.ServiceImplementation.XServices'
has zero application (non-infrastructure) endpoints. This might be because no
configuration file was found for your application, or because no service
element matching the service name could be found in the configuration file,
or because no endpoints were defined in the service element.
at
System.ServiceModel.Description.DispatcherBuilder.EnsureThereAreNonMexEndpoints(ServiceDescription description)
at
System.ServiceModel.Description.DispatcherBuilder.InitializeServiceHost(ServiceDescription description, ServiceHostBase serviceHost)
at System.ServiceModel.ServiceHostBase.InitializeRuntime()
at System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open()
at X.Host.WebServiceHostService.ServiceWorkerMethod().


My System SpecsSystem Spec
Old 03-26-2007   #2 (permalink)
Vadym Stetsyak
Guest


 

Re: Getting an error when hosting in a windows service.

Hello, Kevin!

Do you have config file for the host?
Config file has to have to format
servicename.exe.config.

You wrote on Fri, 23 Mar 2007 11:39:23 -0700:

KB> I get the following exception when I am starting (webservice.Open())
KB> a WCF
KB> service. I have put the same service in a console host and in an IIS
KB> host
KB> with no problem. Any ideas what I can change to successfully host in
KB> a
KB> service? Inside the OnStart method I change the directory from
KB> C:\Windows\System32 to the installation directory so that the
KB> configuration
KB> file can be found. I don't know if that is the source of my problem
KB> or not. I
KB> change the directory using Environment.CurrentDirectory = path and I
KB> do this
KB> before the service is Open. I assume that the configuration file
KB> will be used
KB> on Open?

KB> Kevin

1::11:10 PM - Exception
KB> System.InvalidOperationException: Service
KB> x.ServiceImplementation.XServices'
KB> has zero application (non-infrastructure) endpoints. This might be
KB> because no
KB> configuration file was found for your application, or because no
KB> service
KB> element matching the service name could be found in the
KB> configuration file,
KB> or because no endpoints were defined in the service element.
KB> at
KB> System.ServiceModel.Description.DispatcherBuilder.
KB> EnsureThereAreNonMexEndpoints(ServiceDescription description)
KB> at
KB> System.ServiceModel.Description.DispatcherBuilder.
KB> InitializeServiceHost(ServiceDescription description,
KB> ServiceHostBase serviceHost)
KB> at System.ServiceModel.ServiceHostBase.InitializeRuntime()
KB> at System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout)
KB> at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan
KB> timeout)
KB> at System.ServiceModel.Channels.CommunicationObject.Open()
KB> at X.Host.WebServiceHostService.ServiceWorkerMethod().


With best regards, Vadym Stetsyak.
Blog: http://vadmyst.blogspot.com


My System SpecsSystem Spec
Old 03-27-2007   #3 (permalink)
Kevin Burton
Guest


 

Re: Getting an error when hosting in a windows service.

Yes, there is an equivalent servicename.exe.config.

"Vadym Stetsyak" wrote:

> Hello, Kevin!
>
> Do you have config file for the host?
> Config file has to have to format
> servicename.exe.config.
>
> You wrote on Fri, 23 Mar 2007 11:39:23 -0700:
>
> KB> I get the following exception when I am starting (webservice.Open())
> KB> a WCF
> KB> service. I have put the same service in a console host and in an IIS
> KB> host
> KB> with no problem. Any ideas what I can change to successfully host in
> KB> a
> KB> service? Inside the OnStart method I change the directory from
> KB> C:\Windows\System32 to the installation directory so that the
> KB> configuration
> KB> file can be found. I don't know if that is the source of my problem
> KB> or not. I
> KB> change the directory using Environment.CurrentDirectory = path and I
> KB> do this
> KB> before the service is Open. I assume that the configuration file
> KB> will be used
> KB> on Open?
>
> KB> Kevin
>
> 1::11:10 PM - Exception
> KB> System.InvalidOperationException: Service
> KB> x.ServiceImplementation.XServices'
> KB> has zero application (non-infrastructure) endpoints. This might be
> KB> because no
> KB> configuration file was found for your application, or because no
> KB> service
> KB> element matching the service name could be found in the
> KB> configuration file,
> KB> or because no endpoints were defined in the service element.
> KB> at
> KB> System.ServiceModel.Description.DispatcherBuilder.
> KB> EnsureThereAreNonMexEndpoints(ServiceDescription description)
> KB> at
> KB> System.ServiceModel.Description.DispatcherBuilder.
> KB> InitializeServiceHost(ServiceDescription description,
> KB> ServiceHostBase serviceHost)
> KB> at System.ServiceModel.ServiceHostBase.InitializeRuntime()
> KB> at System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout)
> KB> at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan
> KB> timeout)
> KB> at System.ServiceModel.Channels.CommunicationObject.Open()
> KB> at X.Host.WebServiceHostService.ServiceWorkerMethod().
>
>
> With best regards, Vadym Stetsyak.
> Blog: http://vadmyst.blogspot.com
>
>
>

My System SpecsSystem Spec
Old 04-10-2007   #4 (permalink)
Dwight@QuickLearn
Guest


 

Re: Getting an error when hosting in a windows service.

After verifying that the configuration file is actually being read, check to
make sure that the Service type and the namespace of your service
implementation class all match, namespace, capitalizaiton and all.

hth


"Kevin Burton" wrote:

> Yes, there is an equivalent servicename.exe.config.
>
> "Vadym Stetsyak" wrote:
>
> > Hello, Kevin!
> >
> > Do you have config file for the host?
> > Config file has to have to format
> > servicename.exe.config.
> >
> > You wrote on Fri, 23 Mar 2007 11:39:23 -0700:
> >
> > KB> I get the following exception when I am starting (webservice.Open())
> > KB> a WCF
> > KB> service. I have put the same service in a console host and in an IIS
> > KB> host
> > KB> with no problem. Any ideas what I can change to successfully host in
> > KB> a
> > KB> service? Inside the OnStart method I change the directory from
> > KB> C:\Windows\System32 to the installation directory so that the
> > KB> configuration
> > KB> file can be found. I don't know if that is the source of my problem
> > KB> or not. I
> > KB> change the directory using Environment.CurrentDirectory = path and I
> > KB> do this
> > KB> before the service is Open. I assume that the configuration file
> > KB> will be used
> > KB> on Open?
> >
> > KB> Kevin
> >
> > 1::11:10 PM - Exception
> > KB> System.InvalidOperationException: Service
> > KB> x.ServiceImplementation.XServices'
> > KB> has zero application (non-infrastructure) endpoints. This might be
> > KB> because no
> > KB> configuration file was found for your application, or because no
> > KB> service
> > KB> element matching the service name could be found in the
> > KB> configuration file,
> > KB> or because no endpoints were defined in the service element.
> > KB> at
> > KB> System.ServiceModel.Description.DispatcherBuilder.
> > KB> EnsureThereAreNonMexEndpoints(ServiceDescription description)
> > KB> at
> > KB> System.ServiceModel.Description.DispatcherBuilder.
> > KB> InitializeServiceHost(ServiceDescription description,
> > KB> ServiceHostBase serviceHost)
> > KB> at System.ServiceModel.ServiceHostBase.InitializeRuntime()
> > KB> at System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout)
> > KB> at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan
> > KB> timeout)
> > KB> at System.ServiceModel.Channels.CommunicationObject.Open()
> > KB> at X.Host.WebServiceHostService.ServiceWorkerMethod().
> >
> >
> > With best regards, Vadym Stetsyak.
> > Blog: http://vadmyst.blogspot.com
> >
> >
> >

My System SpecsSystem Spec
Old 04-11-2007   #5 (permalink)
Kevin Burton
Guest


 

Re: Getting an error when hosting in a windows service.

Thank you.

I am not sure the best way to "verify that the configuration file is
actually being read" there are app settings that are getting set so I assum
that the configuration file (app.config) is being read. Namespace matches
(the implementation links).

Kevin

"Dwight@QuickLearn" wrote:

> After verifying that the configuration file is actually being read, check to
> make sure that the Service type and the namespace of your service
> implementation class all match, namespace, capitalizaiton and all.
>
> hth
>
>
> "Kevin Burton" wrote:
>
> > Yes, there is an equivalent servicename.exe.config.
> >
> > "Vadym Stetsyak" wrote:
> >
> > > Hello, Kevin!
> > >
> > > Do you have config file for the host?
> > > Config file has to have to format
> > > servicename.exe.config.
> > >
> > > You wrote on Fri, 23 Mar 2007 11:39:23 -0700:
> > >
> > > KB> I get the following exception when I am starting (webservice.Open())
> > > KB> a WCF
> > > KB> service. I have put the same service in a console host and in an IIS
> > > KB> host
> > > KB> with no problem. Any ideas what I can change to successfully host in
> > > KB> a
> > > KB> service? Inside the OnStart method I change the directory from
> > > KB> C:\Windows\System32 to the installation directory so that the
> > > KB> configuration
> > > KB> file can be found. I don't know if that is the source of my problem
> > > KB> or not. I
> > > KB> change the directory using Environment.CurrentDirectory = path and I
> > > KB> do this
> > > KB> before the service is Open. I assume that the configuration file
> > > KB> will be used
> > > KB> on Open?
> > >
> > > KB> Kevin
> > >
> > > 1::11:10 PM - Exception
> > > KB> System.InvalidOperationException: Service
> > > KB> x.ServiceImplementation.XServices'
> > > KB> has zero application (non-infrastructure) endpoints. This might be
> > > KB> because no
> > > KB> configuration file was found for your application, or because no
> > > KB> service
> > > KB> element matching the service name could be found in the
> > > KB> configuration file,
> > > KB> or because no endpoints were defined in the service element.
> > > KB> at
> > > KB> System.ServiceModel.Description.DispatcherBuilder.
> > > KB> EnsureThereAreNonMexEndpoints(ServiceDescription description)
> > > KB> at
> > > KB> System.ServiceModel.Description.DispatcherBuilder.
> > > KB> InitializeServiceHost(ServiceDescription description,
> > > KB> ServiceHostBase serviceHost)
> > > KB> at System.ServiceModel.ServiceHostBase.InitializeRuntime()
> > > KB> at System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout)
> > > KB> at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan
> > > KB> timeout)
> > > KB> at System.ServiceModel.Channels.CommunicationObject.Open()
> > > KB> at X.Host.WebServiceHostService.ServiceWorkerMethod().
> > >
> > >
> > > With best regards, Vadym Stetsyak.
> > > Blog: http://vadmyst.blogspot.com
> > >
> > >
> > >

My System SpecsSystem Spec
 

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Logging onto a hosting service cpanel with vista...HUH!??!?! won't kathidden Vista General 1 02-09-2007 05:01 PM


Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51