.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Using Windows Service in Web Application.

Posted By:      Posted Date: September 10, 2010    Points: 0   Category :ASP.Net
Hi All,I wanna embed the windows service in the web application. I have seen few posts in the web. where they generate separate exe for the windows service and use it as an installable. The same process i tried doing it but it threw an OS error in my server which is windows 2000 and didnt supported the executable.However the website of mine runs fine in the same server. Thus i was thinking if i cd embed the same code in the web application.Also, in my case the website of mine takes job for simulation. These jobs are taken for simulation execution and nearly takes 12hrs for completion and if they are not completed within twelve hours then they are supplied extra twelve hours to complete the simulation jobs.The simulation executables are a series of executable and bat files.The results of the simulation gets updated in the tables of MySql and hence are displayed to the user.Please let me know as how shd i go abt it.Best Regards,Sharad Jain

View Complete Post

More Related Resource Links

How to Find out Windows service application path from Code ?

Dear frnds, Could you please help me to find out the path of  windows serivce exe ( application path ) from code?   Regards. Sajid P K  

Hosting web service inside Windows Application

  I would like to host my web service inside windows application. I prepared a short example basing on: http://msdn.microsoft.com/en-us/library/aa529311.aspx I have 2 projects created with default templates: Web Service project where I did not change anything: namespace WebService1 { [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] public class Service : System.Web.Services.WebService { public Service() { } [WebMethod] public string HelloWorld() { return "Hello World"; } } } Windows Project in which I changed only the main form class: public partial class Form1 : Form { public Form1() { InitializeComponent(); Uri address = new Uri("soap.tcp://localhost/TestService"); SoapReceivers.Add(new EndpointReference(address), typeof(WebService1.Service)); } } The problem is that when I compile and run this Windows Application, I can`t discover this Web Service. There must be something wrong in my solution. Could you please help me by telling what may be wrong? Thank you for help in advance.MCP

the list cannot be imported because a windows sharepoint service-compatible spreadsheet application

I have googled this for 3 days now, without any solution. I have install, reinstall services and ms office, save as web the excel file for import, without any results, have anyone encounter this error. I need help.

SelfHosted WCF Service in a Windows Form Application

Hey,   I have a simple console app that is a self hosted service and a second console app that acts as the client.  I can pass a message between the client and service.  Obviously for this to work the service has to stay up and running, so I put a Console.ReadLine(); command as the last line in the service console app to prevent the service from closing until the user presses enter. My problem is, I would like to (self)host the service in a windows form.  If, for example, I put the ServiceHost decleration in the form load method, the service does not stay open once the form load method is complete. Does anyone have any tips on how I can self host the service in a windows form application and keep the service alive?   Thanks ;o)

Convert 'Windows Application' to 'Windows Service' .... imposible?


Hi all!

I want run my server application as system service, but i starts the project as 'Windows Application' ... how to convert it now to 'Windows Service' ? :S

I try to add the component "Windows Service", and change the "Application type" to 'Windows Service', but i can't select 'Service1' as my "Startup Object", then when i register de service and launch it from the "Services" magnagement mmc  ... die at 30 seconds because the services mmc can't comunicate with it :(

Nevertheless, if i create a new project like 'Windows Service' runs ok.



How to write the Web service in asp.net for Windows mobile application which find the nearest Restu


hi , i am developing the window mobile application in Asp.net, which will find the nearest Restaurant map on window mobile, but i am new to asp.net ,

  how to write the web service  in which i send my location address and  through window mobile and the web serivce find the neareset Restaurant map on window mobile ,

can this is possible ?

please help me

i dont know how to write the web service for this problem ,


please help me


many thanks in advacne


Connection Pooling VS Steady Connection in Windows Service Application


Hi All,

We are developing a windows service application which queries the sql db every second. For now, we have enabled connection pooling and every time we open and close connection at every access. Since it is a windows service can I open connection at service startup and close the connection shutdown

Please let me know the right approach in this scenario.





"Windows SharePoint Services Web Application" service is showing 'Error starting'.


I just installed MOSS SP2 and ran the config wizard on the server.
I am facing issue with our farm. Found that "Windows SharePoint Services Web Application" is in a problem.

I tried below commands:-
stsadm -o provisionservice -action stop -servicetype spwebservice -servicename ""
stsadm -o provisionservice -action start -servicetype spwebservice -servicename ""
But getting error:- Provision of service failed. Additional information: 1387.

Checked eventvwr and found below error log:-
Event Type: Error
Event Source: Windows SharePoint Services 3
Event Category: Topology
Event ID: 7034
Date:  10/21/2010
Time:  5:16:10 AM
User:  N/A
Computer: <Servername>
An attempt to start/stop instance  of service Windows SharePoint Services Web Application on server <servername> did not succeed. Re-run the action via UI or command line on the specified server.

None of the sites are working and I cannot see anything in the IIS folder nor in the IIS manager. All application folders are missing. But, I can see all the sites & Content databasesin the Central Admin.

Can someone please help?


OCX Control for Windows Service application


I need to use a custom OCX control with a Windows Service application.

I have built a Windows Form application test harness to test interoperability with the OCX control. To do that I added the OCX to the Toolbox, dragged it onto the form and used it successfully.

I now want to do the same in the Service application. However when I create and open the project the OCX control has disappeared from the toolbox.

I have read some similar posts from the past and the general response is that there is no need for an OCX control in a Service application because the service has no visible real-setate to use the OCX on. However in this case the OCX does not have any visual components. It is used to expose functionality to communicate with a third party application. The same third party has provided the OCX to allow others to implement certain functionality in their applications.

Is there any way to be able to use this type of OCX in a Service application? If not, is there a work-around?


Bas Groeneveld

How to call Windows service from another Application



I have Created one  Windows Service using ATL and COM,How to call this Service from My application which is also in ATL and COM.

Please help me.

Web Exception while accessing a Web Service from C# Windows application . Please help


Hi ,

I am trying to consume a webservice from windows application for localtime service.

When I try to fetch the results my application fails with an web exception : Please find the below exception details.

System.Net.WebException was unhandled

  Message="The request failed with HTTP status 407: Proxy Authentication Required."



       at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)


Windows Service Applications Tutorials

You can easily create services by creating an application that is installed as a service. For example, suppose you want to monitor performance counter data and react to threshold values. You could write a Windows Service application that listens to the performance counter data, deploy the application, and begin collecting and analyzing data.

Application Architecture in Windows Forms 2.0

Applications have special support in Windows Forms. For starters, you can manage and tailor your application's lifetime, and, when the work flow is disrupted by an unhandled exception, you can choose from several methods of response. Then, there are several application models that you can employ, including Single Document Interface (SDI) and Multiple Document Interface (MDI) applications, each of which can support either multiple-instance or single-instance mode, the former the VS05 default and the latter requiring special consideration. All applications, however, can discover and use a wide variety of information about the system and environment they execute in.

Application Architecture in Windows Forms 2.0-Single-MDI Applications

Consider an MDI application like Microsoft Excel; files opened from the file system (by double-clicking) are all opened as separate child windows within the parent Excel window.7 For the first instance of an MDI application to open a new child window to display the file that was passed to the second instance of the application, the second instance must be able to communicate with the initial instance.

all basic windows controls,wpf controls,silverlight application

here you will find all the information from basic.

SqlServer - Windows Account to install Application from Gallery


Referring to this tutorial: http://www.asp.net/webmatrix/tutorials/download-and-install-an-asp-net-application

I selected umbraco cms and got this wizard:

I already have Standard Sql Server 2005 on my machine which I wanted to us for above DB and not SqlExpress.

I did not remember "sa" account pwd nor I use explicitly any account to connect to my Sqlserver. I use Windows Authentication account i.e implicit authentication. So I created new account and gave all rights and used it in the above wizard and was able to install the database after some struggle.

My question is: What if I want to use my Windows Account to install the database above? Why the wizard don't have any option to use Windows Integrated Authentication?

Note: I can create the DB with external user I created, just looking specifics for using Windows Authentication for above installation.

Convert WCF service to self hosting application


 I created project as a  WCF Service application and now according to recuriment that needs to be converted as a self hosting application

How can i do this?

Converting WCF service app to Self hosting app?

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend