Adding a service installer and service process installer in visual studio - visual-studio

For some reason, after adding a Installer class to my Windows Service project, I open it up in design mode and right click, but there is no option to add either a service installer or a service process installer. Does anyone know why this may be the case?

In both Visual Studio 2008 and 2010, the best way to do this is to open the ServiceBase component (named Service1 by default) in design mode. Then, right-click in the designer and select the Add Installer option. This adds a ProjectInstaller component along with the necessary assembly references. The ProjectInstaller component, in turn, has the service installer and service process installer added automatically.
Without additional detail, my best guess is that you manually added a component/class to your project and named it Installer instead of letting Visual Studio do the work for you.
See my post here for how to create a basic service in Visual Studio 2008 (seems to work in 2010 as well). Pay particular attention to Step 6.
Hope this helps.

Related

Windows Service Template for Visual Studio 2017

The Windows Service Template no longer displays by-default for new projects in Visual Studio 2017....and the installer has no 'search' capability.
All this AZURE stuff is great, but I still gotta do normal 'on-prem' work too...and I hate maintaining 2 versions of Visual Studio.
Any thoughts here?
Just checked here. I see project "Windows Service (.NET Framework)" under the Windows Classic Desktop folder under Visual C#.
(Visual Basic has a similar entry.)
Only some templates are shown in parent folders, for more specialist templates you need to be more specific.
But also the search finds both.
NB I selected ".NET Desktop" workload on install, which I see you have not.
Check the .NET desktop development option in the installer, then click Modify.
VS2017 --> New project --> Visual Basic or Visual C# --> Windows Classic Desktop --> Windows Service
Also check out this recent post (currently dated 2017-3-30) from MS to do it without the project template:
How to: Write Services Programmatically
The key points are as follows:
Create a new project
Add "System.dll" and "System.ServiceProcess.dll" as References
Create a class inheriting from ServiceBase and create a Program.cs with Main exactly like the template project does
If you are talking Windows Template Studio Universal then You have to install the extension in Visual Studio.
Go to Tools menu >> Extensions & Updates >> Online >>then search for Windows Template Studio
OR go to https://marketplace.visualstudio.com/items?itemName=WASTeamAccount.WindowsTemplateStudio#overview

Visual Studio 2013 doesn't respond after updating the WCF service references from Front End project

Whenever I update WCF service reference in front end project, the service reference update happens and the bottom left corner of Visual Studio indicates that the service reference update is complete, but Visual Studio becomes non responsive after the update. If I close the Visual studio using the Task manager and restart it, reopen the solution, I can proceed as normal and can use the updated service reference. For now I always restart my Visual studio and reopen my solution to continue working on my tasks. Has anyone faced this issue? If anyone found the solution for this issue, could you please help me fixing this as it is very annoying to restart the Visual studio every time I update the service references. Thank you.
(I am using Visual Studio 2013 - project uses .Net Framework, asp.net webforms, and C# as the language for development. - if it helps.)
After trying different options, I guess the size of sln file and the size of references caused the issue for me. We use Resharper in our company which adds extra load when updating the service references.
My Visual Studio doesn't hang/becomes not responsive (most of the times), when i do the following..
1) Go to Tools -> Options -> Source Control - change the default option from Microsoft Git Provider to None.
2) Tools -> Options -> Resharper Ultimate and disabl it.
3) Try to figure out which projects in the solution is not required or affected and unload them.
Then update the reference. Still sometimes it doesn't work for me, but most of the times i dont have to restart the solution using task manager. I always disable resharper before I have to update the service reference and enable it back again once the service reference is updated. Hope it help others if they face similar situations..

Selectable components in Visual Studio 2013 Setup Project

I have created a Visual Studio 2013 Setup Project that installs a Windows Service. Everything works fine up to now, but I need to add an additional component to the installation. This component should install if the user wishes, so, I need something like a selectable component that the user can check its installation if it is desired. I searched the web but not happy results, I don't know if it is possible to do with the Basic Visual Studio Setup Projects Template. I need to know if it is possible, or if I need to move to other Installer's maker like Wix or Installshield. If it is possible, please explain how to achieve it. Thanks

how to add logic to msi installer

I have a Setup Project in Visual Studio 2010 which creates a .msi installer. I am wondering if it is possible to add some logic to check some conditions. e.g if there is my software installed yet.
Thanks,
This is done through installer properties. You can set them and check them against values. They are just like variables in code.
However, Visual Studio is limited when it comes to custom installation logic. If you don't figure out how to do what you need, give us more details.
As a side note, launching the installer for an already installed product makes it go into maintenance mode (Modify, Repair and Remove options). So you don't need to check if your application is already installed.
You need to add installer class to one of your library or assembly. In Visual Studio, attach installer events to custom action. See how http://www.simple-talk.com/dotnet/visual-studio/visual-studio-setup---projects-and-custom-actions/ or here http://msdn.microsoft.com/en-us/library/d9k65z2d.aspx

Webservice Contract First Visual Studio Addin 2008: did someone succeed to install?

I've tried to install this
http://www.thinktecture.com/resourcearchive/tools-and-software/wscf
it seems I have to download the vs2005 version first and then update with a file for vs2008.
But the addin failed to install as for me.
Did someone achieve to do so with VS 2008 ?
You're right. It looks like it is needed to have VS 2K5 before being able to use this add-in.
I guess the setup for VS 2005 tries to add a toolbar or some menu items, so it launches VS 2005, which of course fails if you don't have it.
Instead of preparing a setup program for VS 2008, the author just provides an updated .addin while for it.
Maybe it is enough to extract the files from the .msi (see the back room tech for a link) and then install the .addin file from the zip of the "2008 version".
If you succeed in doing this with the msi, put then this .addin file in a directory where VS 2008 looks for it (see the list in Tools / options / Environment / Addins Macro security).
Inside the .addin, there is the path to the add-in itself, which must be of course adapted.

Resources