Partilhar via


How to fix Visual Studio 2005 setup projects on Windows Vista post-beta 2 builds

I ran across a mail thread today describing some problems that folks have run into while trying to use the setup and deployment project types in Visual Studio 2005 on post-beta 2 builds of Windows Vista. I want to describe the symptoms and how to workaround this issue in case you run to this in your development scenarios.

What are the issues?

When trying to create a new setup project in Visual Studio 2005 on post-beta 2 builds of Windows Vista, an error dialog appears stating "The Operation could not be completed. The parameter is incorrect." The error dialog looks like this:

New setup project error dialog on Windows Vista

When trying to open an existing setup project in Visual Studio 2005 on post-beta 2 builds of Windows Vista, an error dialog appears stating "One or more projects in the solution could not be loaded for the following reason(s): The application for the project is not installed. These projects will be labeled as unavailable in Solution Explorer. Expand the project node to show the reason the project could not be loaded." The error dialog looks like this:

Open existing setup project error dialog on Windows Vista

How can I fix these issues?

The underlying issue will be fixed in Visual Studio 2005 service pack 1. Until then, you can workaround this issue by using the following steps:

  1. Close all instances of Visual Studio 2005 that are running on your system
  2. Click on the Start menu, choose All Programs, then choose Accessories
  3. Right-click on Command Prompt and choose Run as administrator
  4. Click allow to launch an administrator command prompt
  5. Run reg delete "HKLM\SOFTWARE\Microsoft\VisualStudio\8.0\Deployment\Deployables\Setup\Plugins\VJSharpPlugin" /f
  6. Re-launch Visual Studio 2005 and try to open/create a setup project again

This workaround will prevent you from including the Visual J# redistributable package in your project using the bootstrapper, but it will allow you to use the rest of the setup/deployment project infrastructure in Visual Studio 2005.

What is the root cause?

I didn't find detailed information about the root cause of this problem, but the information I found stated that the underlying cause is within Visual Studio 2005 and not Windows Vista. Some Windows APIs that Visual Studio 2005 calls were being used in ways that were not officially documented or supported, and this behavior has been changed in Windows Vista. This is one of the dangers of relying on undocumented API behaviors in an application.

One additional note here - if you found this blog post and are using the Visual Studio 2005 setup/deployment projects, I highly encourage you to check out WiX if you haven't already. The following references are very useful for getting started with WiX:

Comments

  • Anonymous
    October 17, 2006
    I installed Windows Vista RC2 a couple of weeks ago and started working on some of the remaining issues

  • Anonymous
    December 04, 2006
    Question: I have seen some of your previous blog posts (such as this and this ) regarding compatibility

  • Anonymous
    September 13, 2007
    The comment has been removed

  • Anonymous
    November 05, 2007
    Thank you very much... This saved me from re-installing vs 2005

  • Anonymous
    December 28, 2007
    The comment has been removed

  • Anonymous
    January 01, 2008
    The comment has been removed

  • Anonymous
    January 03, 2008
    I often receive emails and blog comments from customers who are having trouble installing the .NET Framework

  • Anonymous
    January 03, 2008
    I often receive emails and blog comments from customers who are having trouble installing the .NET Framework

  • Anonymous
    February 01, 2008
    The comment has been removed

  • Anonymous
    February 02, 2008
    Hi Adityayadav76 - I'm glad you were able to figure out this scenario. One thing - there is a possible way to automate creating non-advertised shortcuts for a Visual Studio setup project.  Starting in VS 2005, setup projects have a post-build task that you can use to run additional steps after the MSI is created.  You could create a script that uses Windows Installer APIs to modify your MSI directly to configure it in ways not supported in the UI for the setup project. There are a couple of examples that I've previously posted of similar scripts that you can use as examples if you'd like: http://blogs.msdn.com/astebner/archive/2006/08/12/696833.aspx http://blogs.msdn.com/astebner/archive/2006/10/23/mailbag-how-to-set-the-noimpersonate-flag-for-a-custom-action-in-visual-studio-2005.aspx Hopefully this helps.