Is it possible to create a Windows Service through Visual Studio Code? - c#

In my visual studio code project, I have generated an .exe file for the project and I'm trying create make my .exe as Windows Service.
From here and here, if I'm not mistaken, these solutions look like done by using Visual Studio instead of Visual Studio Code. Is it possible to create a Window Service through Visual Studio Code?

You cant,
Visual Studio Code is a code editor redefined and optimized for
building and debugging modern web and cloud applications. Visual
Studio Code is free and available on your favorite platform - Linux,
Mac OSX, and Windows.
It has no concept of an Windows Service
If you wish to create a Windows service you will have to use Visual Studio or something that can compile standard .net Windows application
Great comment from Ben Voigt
You're correct that Visual Studio Code doesn't have a concept of a
service, but that's because it is an editor not a compiler. The same
C# compiler installed as part of the .NET runtime, can build Windows
Services. And you can edit the windows service code in VS Code

Related

Is there a replacement for a Windows Service Application in Visual Studio Community 2017?

I want to make a windows service but I do not see a template or reference to anything like that in Visual Studio Community Edition 2017. Is there something else that replaced windows services, or has the nomenclature changed?
If not, is there a place I can download a windows service application template for c# .net 4.5? When I look online I do not see any templates for C# except "xUnit Test Project Template"
Where are the templates?
EDIT:
It turns out my installation did not complete. It was giving an error during installation so I had to delete some temporary files and then it finished installing, and now all of the templates including windows service are there.
The most recent .NET based Windows NT Service development that I have seen had developed using TopShelf:
https://github.com/Topshelf/Topshelf
You create a Windows application and import the TopShelf libraries using Nuget.

Is it possible for me to create a Windows Service in Visual Studio Web 2013?

I don't know why Visual Studio is such that there are a million different versions (Visual Studio for Desktop, Visual Studio for Web, Visual Studio Code, etc.) and each version has a different set of project templates. Anyhow, the problem I'm having is that I'm creating an ASP.NET MVC application through Visual Studio Web 2013 and I want it to be supported by a Windows Service that is started in my App_Start(). The problem of course is that when I read the instructions on https://msdn.microsoft.com/en-us/library/zt39148a(v=vs.110).aspx there is no Windows Service template on Visual C# when I try to add a new project to my solution.
I understand your web endpoint will be dependent on a Windows Servie, and you want to author that windows service as part of your solution.
Setting aside that VS.net 2015 Community Edition rolls up all the functionality you need. You dont need the project template specifically to create a windows service. It just automatically adds some references and templates into your project. All project templates in VS .net rely on the .net framework - and that isn't any different between one installation and another of VS.net.
In practise you can code a windows service written for .net in Notepad and just call the CSC compiler manually - the version of VS.net just adds some ease-of-use.
There is a set of instructions here https://msdn.microsoft.com/en-us/library/9k985bc9(v=vs.110).aspx from Microsoft which include specific instructions on how to make a windows service without a template.

Create service installer for existing C# console application in Visual Studio 2015 Community

I have an app (C# Console application). I know that in Visual Studio 2008 was the template for creating "Setup project".In Visual Studio 2015 Community this template is not available.
What tools inside VS 2015 could help me to pack my app as a Windows service (within Windows 7) and create installer for it?
You may want to check out this extension for vs2k15:
https://visualstudiogallery.msdn.microsoft.com/f1cc3f3e-c300-40a7-8797-c509fb8933b9
Also the learning curve is a bit steep but WiX is widely accepted as a very good solution for creating installers for windows apps. Read more about it here:
http://wixtoolset.org/

Change from Windows Forms to WPF Application

I already made an application that is using Windows Forms, but I knew that Windows Forms setup was no longer available in Visual Studio 2013, that is made me to install both of Visual Studio 2010 and Visual Studio 2013. When I want to make some changes in my application and re-build the setup, I have to run Visual Studio 2010 rather than Visual Studio 2013. The reason because I am using Visual Studio 2013, because I like this version and I am using Visual Studio 2010 just because for when I want to make some changes in my application.
I knew about WPF Applications when I finished made my application. And I am considering to uninstall Visual Studio 2010 and work with Visual Studio 2013. Do I have to re-write everything on my application's code to WPF? Because from what I heard, some functions in WPF are not the same in Windows Forms. And let's say that I successfully change my application from Windows Forms to WPF, what setup is provided with WPF ? So the other users could use my application on their computer?
i knew that Windows Forms setup has no longer available in Visual Studio 2013
Windows Forms is still available as a technology in Visual Studio 2013. If you are referring to the setup project type for creating an installer switching to WPF will not make it available for you.
So you can switch to Visual Studio 2013 and continue using Windows Forms but you will have to find another way to create an installer (and switching to WPF will not fix that problem).
In my opinion the ViX Toolset is very good for creating an installer. However, it is not "drag and drop" as the old Visual Studio Setup project type is.
#Kaoru You have to make some changes, Because some of functions in WPF and Win Forms are different.You don't need to change the Application Logic. But you have to change some modifications in UI and also code.
I heard a tool something called WF2WPF But I never used it and not found yet it.
If you are missing installer projects in VS 2013, then you may want to try Visual Studio Installer Projects Extension.
This preview release provides support for Visual Studio Installer projects in Visual Studio 2013. You can download the extension from the Visual Studio Gallery.

Can't use WCF templates in Visual Studio Express

I've used the Visual Studio 2010 Express All-In-One to install Visaul C# and Visual Web Developer.
Once I opened Visual C# and tried to create a WCF Application, I couldn't find it.
After looking on internet I found a tip to do it on stackoverflow.
I have done exactly like the guy explained, and now I have WCFServiceProject.
Now everything seems to be correct, but when I try to create a WCF project I get this error
Any ideas ?
Using Visual Studio Express, you have to explicitly start Visual Web Developer Express to create a project of type WCF Service Application.
Visual C# Express even doesn't allow to add existing WCF projects to an existing solution.
If your installation doesn't offer this type of project from the (default) installed project types you should check your installation options.
I don't think you have the option to create a WCF Application in Visual Studio 2010 Express.

Categories