I am working on VS 2008 and 3.5 framework.
I had three windows services.
I placed all three in a single solution, created installer individually for each of them.
Then created a setup project.
When I build it says build failed .
But I checked on the errorlist, (i enabled the diagnostics in options menu), but there was no error at all.
I went ahead and installed. There were no issues, But there was no service showed up in the services.msc.
I installed each service individually , using installutil command, it showed up.
But my requirement is to bundle these services and deploy to the client.
The client should install it.
Where am I going wrong.
Any inputs will be highly appreciated.
Regards
cmrhema
I notice your comment above about omitting the custom action. Same mistake I made! For posterity, here's the entire process:
Make sure you have added the project installer to your service project (described here). These components give your service EXE the ability to register itself with the service manager.
Add a setup project to your solution.
Add the primary output from your service project to the setup project (described here). This puts the binary into the application directory.
Add a custom deployment action to your setup project containing the primary output from your service project. This looks like a repeat of step 3, but what it's actually doing here is registering your service with the service manager.
This walkthrough goes through each of these steps in some detail.
I too have a similar problem with VS 2008 and I believe it is a bug in the IDE rather than anything you're doing wrong.
Basically what happens is that VS reports a failed build, but does not indicate any reason for the failure. I find that restarting Visual Studio and then performing another build allows the build to succeed.
I read somewhere that for some people the bug is caused by some auto-created project file, but a restart fixes the problem for me.
Build failed -> what else is there in the Output window?
For some general reference regarding setup projects for windows services in .net:
http://msdn.microsoft.com/en-us/library/aa983650%28VS.71%29.aspx
http://support.microsoft.com/kb/317421
Related
I have created a C# 4.0 WinForms application using Visual Studio 2010 Premium SP1 on Windows 10.
Over the months I have modified and deployed this same App many times, using ClickOnce.
I have never had any difficulty until today.
I made one small modification to the code, which works successfully.
However, after building, and attempting to publish, 2-separate errors are thrown, as listed below.
#1) Cannot publish because a project failed to build.
#2) An error occurred while signing: The parameter is incorrect.
My application does contain a separate project, which is only a Splash Screen project.
If I go to Solution Explorer and attempt to build the 2nd project, it builds fine.
I have also tried to Build > Publish by using the menu in Solution Explorer, rather than from the Publish pane of VS.
Not only is it puzzling why a publish is failing suddenly now, but the error messages do not provide any clue as to where in the code a problem is arising, if indeed it's in the code.
Can anyone suggest how to correct this situation, as I am unable to publish my app any longer.
This error was puzzling, as I've used ClickOnce to deploy modified versions of my App many times. On a hunch, I decided to change the TimeStamp server from the following:
http://timestamp.globalsign.com/scripts/timstamp.dll
to this:
http://timestamp.globalsign.com/?signature=sha2
Since researching this error referenced the fact that Microsoft would no longer recognize SHA1, but needed the SHA2 cryptography, I tried using this latter server and after compiling, it allowed my app to do a successful publish.
If anyone else runs into this problem, the above solution may prove useful.
Hi i'm new in Windows Service c#. i followed tutorials and it works perfectly after installation.
Now my problem is when i modify the fonctionnality of the service (modifying c# code), and i uninstall & install the windows service, the functionnality remains that of the first installation.
I even restarted the PC and the functionnality and the functionality has not changed
Is there someone who had this problem?
I also had the same problem.If you are using visual studio installer, just delete the .msi and setup.exe from "XXX\Release" folder and rebuild visual studio installer project. It will recreate both files with updated code changes.
Right click solution > rebuild. Then run your service again.
In order run the updated service in Windows which is created in c# follow below steps
First of all stop that service in windows service manager (services.msc)
Then go to build menu in Visual Studio and click on Rebuild Solution
Then go to services and start the service again.
In this way the updated service will run if it is build successfully and the service is created accurately otherwise you will get Service Failure alert in Windows with specific error code.
I had the same issue and the solution I tried is different from the marked answer.
Right click the setup project (you get a popup window). Click Configuration Manager button at top right, from Active solution configuration dropdown, check whether the selected value is Release. If it is Release then Release folder is updated on building the project; else Debug folder.
Hope this will help a few having such an issue.
I would like to create a patch for my .NET application. The requirements are:
Find the installation directory
Overwrite the old files with the new ones
Restart a windows service
I want to send the updater to the user so that they simply run it and update the application. My original installer is created using Visual Studio Deployment Project.
I did alot if research, and found this:
https://stackoverflow.com/questions/3767/what-is-the-best-choice-for-building-windows-installers
How to Update the installed Window Application (Creating Patches)
http://wyday.com/forum/viewtopic.php?f=1&t=245&p=793&hilit=offline+install#p793
http://www.advancedinstaller.com/user-guide/tutorial-patch.html
I tried created another installer which would just contain the files I need to replace, however I could not find a way to determine the installation directory of my application.
WyBuild seemed like a good solution, however they do not support an offline install and require you to host the update files on the server.
I tried creating a patch using Advanced Installer but it just generates a bunch of build errors that I could not fix.
There are tutorials how to modify the MSI files using Orca or WIX, but that seems alot more complicated than it should be.
I am tempted to roll my own but I am not sure how to go about it, and this seems like such a basic requirement that there's got to be a solution out there already.
If you already use a a VS Setup Project you can deploy the new version of this project and it will upgrade existing installations. Have a look at the setup and upgrade ids. The stop and start of the service can be done by custom actions that can be defined in the project and will be executed i.e. when your setup is committed or rollbacked etc.
We found a bug in Web Service Software Factory a description can be found here. There has been no updates on it so we decided to download the code and fix it ourself. Very simple bug and we patched it with maybe 3 lines of code. However* we have now tried to repackage it and use it and are finding that this is seemingly an impossible process.
Can someone please explain to me the process of PLKs? I have read all about them but still don't understand what is really required to distribute a VS package.
I was able to get it to load and run using a PLK obtained from here, but i am assuming that you have to be a partner to get a functional PLK that will be recognized on other peoples systems?
Every time i try and install this on a different computer I get a "Package Load Failure". Is the reason I am getting errors because I am not using a partner key? Is there any other way around this? For instance is there any way we can have an "internal" VS package that we can distribute?
Edit
Files I had to change to get it to work.
First run devenv PostInstall.proj
Generate your plks and replace ##Package PLK## (.resx files)
--Just note that package version is not the class name but is "Web Service Software Factory: Modeling Edition"
-- And you need to remove the new lines from the key
ProductDefinitionRegistryFragment.wxi line 1252(update version to whatever version you used in plk)
Uncomment all // [VSShell::ProvideLoadKey("Standard", Constant in .tt files.
The short answer is no, you don't need to be a VSIP partner registered with Microsoft to obtain and use a PLK. The PLK you obtained from the site should work on any VS install. (On a related note, Microsoft has eliminated the requirement for PLK's altogether for VS 2010.)
The following pages should help with debugging what the issue is:
http://msdn.microsoft.com/en-us/library/bb164677.aspx
http://blogs.msdn.com/dr._ex/archive/2006/12/14/debugging-package-load-failures.aspx
There is also a tool in the Visual Studio 2008 SDK called the Package Load Analyzer that should help you debug the load failure (and confirm that it's actually a PLK issue and not something else). Copy and run VSSDK_PLA.exe (under VisualStudioIntegration\Tools\Bin under the VS SDK install location) to your test machine to install the Package Load Analyzer tool.
You don't have to worry about package load keys when rebuilding the Web Service Software Factory because it is a guidance package that depends on GAX, which has the only PLK needed. To build guidance packages, like the Service Factory, you also need to have GAT installed.
The Service Factory source should contain the setup projects you need to build and redeploy it. If you have an issue, the discussion forums on its community site (http://servicefactory.codeplex.com) are monitored by team members. Response is pretty good.
Aaron is right that this whole story gets a LOT easier in VS2010. VSIX is pretty sweet. We are updating the Service Factory to VS2010. It should be ready for release within a month.
Don
MS p&p
I have a Visual Studio setup project that installs an application into the task scheduler and also installs a GUI application to manage some configuration parameters in the registry. This being the case, the setup project installs two different primary outputs (.exe's) as part of the process.
I am getting the following warning when I rebuild the setup project:
Configuration file 'C:\my\App.Config'
is being used to configure all
executables
Is there any way to remove this warning? The suggested MSFT solution apears to be to use a different setup project for each .exe, but I only want the users to have to run one installer. Any suggestions?
There was a <runtime> section in my App.Config file and once I removed this portion of the config file the issue went away.
Maybe you could create an installer that launches all the other installers.
This isn't a particularly helpful on microsofts part is it?
Another idea might be to take their advice and use either no config file or a custom file format so that you avoid this error.
From Choosing a Windows Installer Deployment Tool, it looks like the built-in windows installer maker is essentially deprecated ("Future versions of Visual Studio will not include the Visual Studio Installer project templates.")
This page also recommends InstallShieldLE and Windows Installer XML Toolset. I've just used InstallShieldLE to create an install that includes multiple executables and it appears to have worked (I'll edit this if it turns out it didn't work).
For very complicated installs, I've used NSIS in the past with great success - I'm not sure how much extra effort NSIS requires over InstallShieldLE for simple installs.