tags:

views:

541

answers:

6

I am less than a week into my Visual Basic education. I have downloaded Visual Studio 2008 and am teaching myself Visual Basic 2008 in hopes of landing a particular contract position.

In the meantime, a friend of mine told me that it is not recommended to write a Windows Service with Visual Basic. Is that true? Could he be referring to some much older version than 2008? Does the .NET version come into play?

What is at stake is that the company that my friend works for is going to completely re-write a component of their flagship product at great cost and expense and simply abandon their existing VB code. If the only hang-up is getting it to run as a service then they could save a lot of money if Visual Basic could, in fact, run reliably as a service.

+3  A: 

There is no reason that Visuale Basic .net can't write a windows service. You can select a project which will create a windows service under the "Windows" projects in the Visual Basic section.

Kevin
It sounds more like a language war / debate than any REAL reason. VB.Net will run as a service just fine and without any major downfall to say C#.
klabranche
+3  A: 

You can write .NET services in any CLR language, including VB.NET --- your friend was thinking of VB6 and earlier.

(I do recall some fairly crazy kludges that allowed services to be written in VB6, but for all practical purposes, services written in VB6 weren't really a viable solution...)

John Booty
The amazing thing about those VB6 kludges is that they worked at all. The source for the MS one was released, very clever, but rather relied on everything just working.
Richard
+1 but he should keep in mind that writing services is a tad dangerous since a small slip can cause it to run amok on the system.
Joel Etherton
+1  A: 

Writing a Windows Service in VB.NET (using any version of Visual Studio >= 2003) is just as effective as writing a Windows service in any other language.

Your friend may have been thinking of Visual Basic 6...or he's partial to another .NET language.

In either case...you should be fine to keep going on your path the way you are.

Justin Niessner
A: 

.NET certainly allows you to use Visual Basic to write a Windows Service. I believe there is even a default project template to do so. Here is an tutorial as such: http://www.vbdotnetheaven.com/UploadFile/mahesh/Winservvb11172005233242PM/Winservvb.aspx

All .NET code is converted to an intermediary language that is executed, thus all .NET languages can be used to write a windows service.

Rob Fuller
A: 

Your friend may be referring to Visual Basic, not VB.NET.

While VB.NET has syntax that is similar to Visual Basic and some convenience functions are still present, they are two entirely different languages and environments.

Your friend is correct in stating that Visual Basic (meaning 6 and earlier, not VB.NET) is a poor choice of a language for a service (or any new application), but VB.NET is every bit as legitimate as C# or any other CLR language.

It may be useful to refer to what you're learning as "VB.NET" or "Visual Basic .NET", rather than just "Visual Basic".

Adam Robinson
A: 

Is it possible to create a windows service in "vb6"? if yes, how?

ajax