Thoughts about setup and deployment issues, WiX, XNA, the .NET Framework and Visual Studio
All postings are provided AS IS with no warranties, and confer no rights. Additionally, views expressed herein are my own and not those of my employer, Microsoft.
There is a new general-purpose installation troubleshooting tool called the Program Install and Uninstall Troubleshooting Tool that has been available on the Microsoft support site for a little while, and I want to post some information about this tool to help make it easier for people to find it.
This tool is conceptually similar to the .NET Framework cleanup tool, but it is more generic and can be used to clean up any MSI-based installation on a computer. It also performs more robust back-up steps prior to cleaning up in case you need to roll back to a previous state.
Where to download the Program Install and Uninstall Troubleshooting Tool
You can find more information about the Program Install and Uninstall Troubleshooting Tool and download it from the following locations:
Summary information about the tool
The Program Install and Uninstall Troubleshooting Tool can be used to automatically diagnose problems that can prevent installing and uninstalling programs on your computer. It can help resolve some errors that prevent programs from uninstalling, installing or updating correctly. Here is a list of issues that this tool is currently able to fix:
This tool is designed as a last resort for cases where install, uninstall, repair or patch installation did not succeed for unusual reasons. It is not a substitute for the standard uninstall procedure. You should use only use this tool to uninstall a program if the program fails to uninstall using the entry in the Programs and Features control panel.
More details about how the tool works
The Program Install and Uninstall Troubleshooting Tool does the following behind the scenes when you use it to uninstall a program:
The Program Install and Uninstall Troubleshooting Tool requires Windows Installer product codes in order to know what file and registry information to remove from the computer. For programs that are listed in the tool UI, the product code will appear as a tool tip when you mouse over the product name. If you choose the Not Listed option in the tool UI, you can use a tool like MsiInv to determine the product code.
If you use the Windows Phone SDK 7.1, it is possible to get an error like the following when building a Silverlight project:
The target "GetCopyToOutputDirectoryContentProjectItems" does not exist in the project.
How to resolve this issue
In the cases that I’ve seen this error in the past, it was caused by XNA Game Studio 4.0 not being correctly installed on the computer. If you encounter this error, I suggest trying one of the following:
More details about the root cause of the issue
The GetCopyToOutputDirectoryContentProjectItems target is defined in an MSBuild .targets file installed by XNA Game Studio 4.0. In the Windows Phone SDK 7.1, one of the Silverlight .targets files has a dependency on this XNA Game Studio 4.0 build target in order to support building the new combined Silverlight and XNA applications. This dependency exists for standard Silverlight projects in addition to Silverlight and XNA application projects. As a result, it is possible to get into a state where you cannot build a Silverlight project in the Windows Phone SDK 7.1 when XNA Game Studio 4.0 is not installed even if you are not using XNA Game Studio features in your Silverlight project.
I have seen several people ask about this scenario on the App Hub forums, and I wanted to write a blog post to help raise visibility because it is hard to find in the release notes.
Description of the issue
The Windows Phone SDK 7.1 introduces the ability to create applications that combine Silverlight and XNA Framework technologies. If you create a new Windows Phone Silverlight and XNA Application using the project template that ships with the Windows Phone SDK 7.1, you will see a warning like the following in the Visual Studio error window:
The project 'SlXnaApp1Lib' cannot be referenced. The referenced project is targeted to a different framework family (.NETFramework)
This warning will not prevent you from building or running the Silverlight and XNA Application project, and you can safely ignore the warning.
A Silverlight and XNA Application includes a Silverlight project, an XNA Game Studio Windows Phone Game Library project and an XNA Game Studio content project. The Silverlight project is the parent project, and it includes a project-to-project reference to the XNA game library project. The warning occurs because Visual Studio detects that the XNA project does not target the same .NET Framework profile as the Silverlight project. However, on Windows Phone, there is only one .NET Framework profile, regardless of what the target framework settings are in the project files, so the warning does not indicate any possible functional problems when you build and run your application.