How to: Register Custom Data Generators
After you have authored a custom generator, you must register it on your computer before Data Generator can use it. To register a generator, you must sign the .dll file with a strong name and copy the .dll file to the Private Assemblies folder or the global assembly cache. You must also create an Extensions.xml file.
To register a custom generator
Open your completed data generator project.
In Solution Explorer, right-click the project to open the Properties page.
On the Signing tab, select the Sign the assembly check box, and type a name for the key file to sign the assembly with a strong name. For more information, see How to: Sign an Assembly with a Strong Name.
On the View menu, click Other Windows, and then click Command Window to open the Command window.
In the Command window, type the following code. For
FilePath
, substitute the path and file name of your compiled .dll file. Include the quotation marks around the path and file name.Note
By default, the path of your compiled .dll file is YourSolutionPath\bin\Debug or YourSolutionPath\bin\Release.
? System.Reflection.Assembly.LoadFrom("FilePath").FullName
? System.Reflection.Assembly.LoadFrom(@"FilePath").FullName
Press ENTER.
Copy the resultant line to the Clipboard. The line should resemble the following:
"GeneratorAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=nnnnnnnnnnnnnnnn"
Open a plain-text editor, such as Notepad.
Provide the following information, specifying your own assembly name, public key token, and extension type, by using the information that you copied in a previous step:
<?xml version="1.0" encoding="utf-8" ?> <extensions assembly="GeneratorAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=TokenKey" version="1" xmlns="urn:Microsoft.VisualStudio.TeamSystem.Data.Extensions" xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:Microsoft.VisualStudio.TeamSystem.Data.Extensions Microsoft.VisualStudio.TeamSystem.Data.Extensions.xsd"> <extension type="GeneratorNamespace.GeneratorClassName" enabled="true" /> </extensions>
Note
The extension type is of the form "namespace.classname". The assembly name does not contain the ".dll" extension.
Save the file by using the following information:
File name
TestGenerator.Extensions.xml
Location
[Program Files]\Microsoft Visual Studio 8\DBPro
Copy your compiled .dll file to the following location:
Location
[ProgramFiles]\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies
Close Visual Studio.
Re-open Visual Studio.
Your generator is registered and ready to use.
Security
For more information, see Security of Data Generators.
See Also
Tasks
How to: Create Custom Data Generators
Walkthrough: Creating a Custom Data Generator