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:
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:
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:
- Close all instances of Visual Studio 2005 that are running on your system
- Click on the Start menu, choose All Programs, then choose Accessories
- Right-click on Command Prompt and choose Run as administrator
- Click allow to launch an administrator command prompt
- Run reg delete "HKLM\SOFTWARE\Microsoft\VisualStudio\8.0\Deployment\Deployables\Setup\Plugins\VJSharpPlugin" /f
- 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: