471,088 Members | 1,294 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,088 software developers and data experts.

Hosting in Windows services

Hi,

I created a web service that I want to host in windows service. The
problem is that if I host it as windows service it does not use the
configuration file. I have to define the binding, endpoint etc.
programmatically in the Program.cs file.

Any idea what I might be doing wrong?

Cheers,

Manjree
Jun 27 '08 #1
1 1879
Hi Manjree,

From your description, you're using windows service to host a WCF service,
however, you found that the windows hosted WCF service can not use
configuration file to do the service & endpoint configuration ,correct?

Based on my research, windows service hosted WCF service also read
configuration from the app.config file. I've also performed test through
the approach mentioend in the following MSDN reference:

#How to: Host a WCF Service in a Managed Windows Service
http://msdn.microsoft.com/en-us/library/ms733069.aspx

the steps are as below:

** create a C# .NET windows service project

** add WCF service interface/class in it (also with the system.serviceModel
configuration in the windows service project's app.config file)

** add code to create servicehost in windows service's "OnStart" event, and
close it in "OnEnd" event.

** add a installer class for the windows service

** install the windows service via "installutil.exe" from visual studio
command prompt

after the above, when I start the windows service from mmc console, I can
correctly visit the meta data(wsdl) page and call it from other application.

For your scenario, are you also using the built-in project type to create
the windows service? Or is there anything different here?

If there is anything I missed, please feel free to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
From: =?Utf-8?B?TWFuanJlZSBHYXJn?= <ga**@newsgroup.nospam>
Subject: Hosting in Windows services
Date: Wed, 21 May 2008 07:15:04 -0700
Hi,

I created a web service that I want to host in windows service. The
problem is that if I host it as windows service it does not use the
configuration file. I have to define the binding, endpoint etc.
programmatically in the Program.cs file.

Any idea what I might be doing wrong?

Cheers,

Manjree

Jun 27 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Stimp | last post: by
5 posts views Thread by Gary Webb | last post: by
2 posts views Thread by Nitin Verma | last post: by
6 posts views Thread by =?Utf-8?B?ZGF2ZWJ5dGhlc2Vh?= | last post: by
3 posts views Thread by Barrie Wilson | last post: by
4 posts views Thread by K | last post: by
14 posts views Thread by Jeff | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.