English 中文(简体)
Can t uninstall a service developed in Visual Studio
原标题:

I have a Visual Studio project consisting of a service and an installer for it. During the development I have installed and uninstalled the msi-package at least fifty times but last time I tried to uninstall it I got an error message saying "the installed product does not match the installation source" and if I click "Ok" on that message i get the following: "The path xxxxxx.msi cannot be found." So, first it doesn t match and then cannot be found. Or something. The msi-package do exist on the path given in error message (I have replaced the real path and package name by xxxxx).

What I mean by installing the service is double clicking the msi-package that the "Build Solution" function creates and by uninstalling I mean Control Panel -> Add or Remove Programs.

I use Windows XP and Visual Studio 2003 in this particular project.

I have installed and uninstalled this and other visual studio developed services hundreds or thousands of times but have never had this problem before.

What should I do?

问题回答

I ve seen this happen before. Essentially the installer (.msi) windows wants to use is not available where it believes it should be stored. Why this happens I m not entirely sure but to fix it you have a couple of options.

  1. Put your MSI in the place where windows is looking for it
  2. Forcefully remove your product entry from the MSI catalog using MsiZap. This option is a bit riskier since it s deleting all references to your service vs actually uninstalling it. However the risk is low if it s a service you ve developed and it s just your dev machine.

Another utility I ve used to get rid of a Windows service is sc.exe. You can do something like: sc.exe delete "Service name". Restarting the machine also helps sometimes.

I had a problem just like this one, where a service in Visual Studio somehow became corrupted and could be neither fully uninstalled nor installed. I managed to fully uninstall it using an online tool at https://support.microsoft.com/en-us/help/17588/fix-problems-that-block-programs-from-being-installed-or-removed.





相关问题
building .net applications without Visual Studio

I m interested to hear about people working with building .net applications using MSBuild, NAnt or similar tools. What are you using, why are you using it instead of the VS IDE? I like to use ...

Tips for debugging a made-for-linux application on windows?

I m trying to find the source of a bug I have found in an open-source application. I have managed to get a build up and running on my Windows machine, but I m having trouble finding the spot in the ...

Visual Studio 2010 Beta 2: Can I print in color?

I have to turn in a hard copy of some code with an assignment. Is there any way in Visual Studio 2010 to print C# source code with syntax highlighting? PS: The assignment is solving a math problem, ...

Set Select command in code

On button Click I want to Set the Select command of a Gridview. I do this and then databind the grid but it doesn t work. What am i doing wrong? protected void bttnView_Click(object sender, ...

WPF design-time context menu

I am trying to create a custom wpf control, I m wondering how I can add some design-time features. I ve googled and can t seem to get to my goal. So here s my simple question, how can I add an entry ...

热门标签