views:

915

answers:

5

I have build an application to parse Xml file for integrating data in mssql database. I'm using Visual c# express. There's a way to make service with express edition or I a have to get Visual Studio to do it?

+6  A: 

Absolutely you can. You can even do it with csc. The only thing in VS is the template. But you can reference the System.ServiceProcess.dll yourself.

Key points:

  • write a class that inherits from ServiceBase
  • in your Main(), use ServiceBase.Run(yourService)
  • in the ServiceBase.OnStart override, spawn whatever new thread etc you need to do the work (Main() needs to exit promptly or it counts as a failed start)

Resources

Marc Gravell
A: 

You could try Visual Web Developer Express along with the coding4fun developer kit library for web services (via managed code wrappers):-

http://www.microsoft.com/express/samples/c4fdevkit/default.aspx

cyberbobcat
A: 

Express Edition can write and compile Windows Service projects, but it can't create them normally. The only easy way is to create a new service project in Visual Studio, and then copy the project files to the machine with Express Edition. After that you don't need Visual Studio any more.

There are 3 ways to accomplish this:

  • Go to a machine with Visual Studio and create the project
  • Google an online tutorial for creating services and download the project source code
  • Download and install a 90 day trial version of Visual Studio to create the project

However you'll still run into some difficulties such as if you want to rename your project or not have to repeat this for every new service. The best long term solution is to get the boss to finally pay for a copy of Standard or Professional edition.

David
A: 

According to this MSDN article you don't have the project template for a service. But I'm pretty sure that if you know what the template does for you, you can create and compile a service.

Alex Shnayder
+2  A: 

See http://www.developer.com/net/csharp/article.php/2173801

Don't forget the installer class. ;)

ctrlalt3nd