views:

61

answers:

3

I want to create a windows service, and I am not sure whether to write it on c sharp or c++. I wander if you create the service in c#, do I need to have the whole .net framework installed on the client? If I do it in c++, as a clr application, it will use the .net framework and it will be managed code. Does that mean that the .net framework has to be installed in the client running the windows services? Is the CLR installed in all pc?, i mean, if I write a .net server (c# or c++), is the clr already installed in the client, do I need to have something in mind when deplying the windows service to a client machine

Many thanks for your help

A: 

Managed C++ requires the .NET framework to be installed on the client's machine, as does an application written in C#.

The .NET Framework is installed on Windows Vista, and Windows 7 (2.0 and 3.0 respectively) however can be removed by the user.

It is best to check if they've got it installed and allow them to download/install it as part of your application's installation process.

Michael Shimmins
+1  A: 

Any code that uses .Net requires the .Net framework installed on the machine where it has to run. So, regardless of whether it's C# or C++, if you're using .Net framework, you'll need to have the framework installed.

.Net framework comes pre-installed with Windows Vista and Windows 7 too, I believe. You can check the list of OS that have .Net framework pre-installed (anyway, it's not that big).

CLR is installed in all machines that have .Net framework, because CLR is part of .Net framework.

So, if you're installing a .Net-based Windows Service, here are your checkpoints:
Check if the system has .Net Framework (that is compatible with your service).
If not, then install the .Net Framework first.
Else, go ahead and install the service. Start it and you're good.

Sidharth Panwar
A: 

You should make sure the .NET framework is installed on client machine, but this is not a big concern. Due to this Scott Hanselmann's blog almost 90% of PC have installed some version of .NET frameworkL:

http://www.hanselman.com/blog/HowManyPCsInTheWorldHaveTheNETFrameworkInstalled.aspx

To avoid incompatibility problems, make sure the version you write code will be the same or older than client machine's.

Andrzej Nosal