473,397 Members | 1,985 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,397 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 2062
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.