Troubleshooting Feature Extensions

Visual Studio 2010

You can create your own feature extensions, such as custom code analysis rules, database unit test conditions, data generators, refactoring types, build contributors, and deployment contributors. When you install these feature extensions, issues might arise that prevent your extension from loading successfully. This topic discusses the most common issues and the steps that you can take to address them. For more information about how to install and register feature extensions, see How to: Register and Manage Feature Extensions.

After you install and register your feature extension, you must restart Visual Studio. The first step that you should take after you restart Visual Studio is to display the Error List. If one or more extensions could not be loaded, errors might appear in the Error List. On the View menu, click Error List. If an error such as the following appears, your extension did not load correctly:

Next, you must install and register the assembly so that it will be loaded when you deploy database projects.

The Extensions.XML File was not Found

If you did not provide an XML file to register your extension with Visual Studio, your extension will not be loaded. Typically, you copy the MyAssembly.Extensions.XML file to the %Program Files%\Microsoft Visual Studio 10.0\VSTSDB\Extensions\MyExtensions folder, where MyAssembly is the name of your extension.

Note

We recommend that you do not copy your XML files directly into the [Program Files]\Microsoft Visual Studio 10.0\VSTSDB\Extensions folder. If you use a subfolder instead, you will prevent accidental changes to the other files that are provided with Visual Studio.

The Extension Assembly was not Found

If you did not copy your extension assembly to the Extensions folder, your extension will not be loaded. Typically, you copy the MyAssembly.dll and MyAssembly.pdb files to the %Program Files%\Microsoft Visual Studio 10.0\VSTSDB\Extensions\MyExtensions folder, where MyAssembly is the name of your extension.

Note

We recommend that you do not copy your XML files directly into the [Program Files]\Microsoft Visual Studio 10.0\VSTSDB\Extensions folder. If you use a subfolder instead, you will prevent accidental changes to the other files that are provided with Visual Studio Premium.

The Code in the Extension Does Not Extend the Correct Classes

For each type of feature extension, your primary class extends a specific base class. If you do not inherit from the correct base class, your extension will not function correctly. For more information, see the corresponding walkthrough.

Classes or Members in the Extension Do Not Have the Correct Attributes

For each type of feature extension, the class must have an attribute that declares the type of database schema providers with which the extension is compatible. In addition, some extensions require additional attributes on one or more of the class methods. For more information, see the corresponding walkthrough.