473,231 Members | 1,865 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,231 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 2048
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Stimp | last post by:
Hi all, I'm going to be moving my site to a new hosting provider at the end of the month. Can anyone recommend a good windows (.NET) hosting provider? My requirements are as follows: -...
5
by: Gary Webb | last post by:
Is it possible to host a .NET Web Service (managed code using the .NET Framework 1.1) without IIS? I remember a website that indicated it was possible to use a .NET Remoting server to host a Web...
2
by: Nitin Verma | last post by:
Hi All, Am new to web service technology. Currently i created a web service at my home box. Now i want to Host/Publish it to the outside world... so that it is used by my web applicantion as...
3
by: jonny | last post by:
Please recommend a Web Hosting Service that supports ASP.NET and SQL server. I am new at this and just signed up with Yahoo before I new any better. It appears that yahoo does not support ASP.NET...
6
by: =?Utf-8?B?ZGF2ZWJ5dGhlc2Vh?= | last post by:
Dear List, I have been writing Web Services and running them from either a local IIS Server on XP Pro or within the built in web server in VS2003 and more recently VS2005. I was considering...
3
by: Barrie Wilson | last post by:
I have a really simple test app which consumes two public web services (one stock quote and one Amazon books collection); it works just fine when posted on my local servers but when I publish it...
4
by: K | last post by:
Hello everyone, I understand that urllib and urllib2 serve as really simple page request libraries. I was wondering if there is a library out there that can get the HTTP requests for a given...
14
by: Jeff | last post by:
Hello I'm teaching myself web programming in ASP.NET using freely available online resource and videos. It's going really well and I've built myself some personal web pages based on the Visual...
4
by: Dave Burns | last post by:
I am self hosting a Web Service in a Windows service. I am trying to start the service using the NT AUTHORITY\NetworkService account. I get a NullReferenceException on ServiceHost.Open() in the...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.