locked
Custom Data Generator not appearing in VS2008

    Question

  • I created a custom data generator but can't get it to appear in my data generation plan in VS2008 (Team System) SP1.

    The code:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Microsoft.VisualStudio.TeamSystem.Data.DataGenerator;
    
    namespace CustomDataGenerators
    {
        public class NameGenerator: Generator
        {
            int minLen = 0;
            int maxLen = 8;
            string name = "";
            
            [Input]
            public int minimumLength
            {
                set { minLen = value; }
                get { return minLen; }
            }
    
            [Input]
            public int maximumLength
            {
                set { maxLen = value; }
                get { return maxLen; }
            }
    
            [Output]
            public string outputString
            {
                get { return name; }
            }
    
            protected override void OnGenerateNextValues()
            {
                name = "foo" + new DateTime().ToString();
            }
        }
    }
    This compiles into CustomDataGenerators.dll.

    I also created a CustomDataGenerators.Extensions.xml file:
    <?xml version="1.0" encoding="us-ascii"?>
    <extensions assembly="CustomDataGenerators, Version=1.0.0.0, Culture=neutral, PublicKeyToken=95510968c816b5ce" 
    	version="1" xmlns="urn:Microsoft.VisualStudio.TeamSystem.Data.Extensions" 
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    	xsi:schemaLocation="urn:Microsoft.VisualStudio.TeamSystem.Data.Extensions Microsoft.VisualStudio.TeamSystem.Data.Extensions.xsd">
        <extension type="CustomDataGenerators.NameGenerator" enabled="true" />
    </extensions>
    
    I placed both the DLL and the XML file into the ...Microsoft Visual Studio 9.0\DBPro\Extensions directory.  I ran the gacutil /if command on the DLL.

    But when I open a new instance of VS2008 and open my data generation plan, my custom data generator is not listed as an option.

    Any ideas as to what I'm missing?

    Thanks.



    Tuesday, May 12, 2009 9:56 PM

Answers

  • Further clarification:

    * The extensions.xml file should reside in the ...Microsoft Visual Studio 9.0\DBPro directory
    * The .dll file must either be put into the ...Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies directory or be GAC'd
    -Genevieve Orchard (VSTS Database Edition Test Team)
    • Marked as answer by David Mahaffy Thursday, May 14, 2009 8:08 PM
    Wednesday, May 13, 2009 11:56 PM

All replies

  • David,

    Just to verify, you have not installed the GDR version of Database Edition? If so, I don't see anything obviously wrong, and it's been a while since I created a custom generator for VS2008, but you might try changing the encoding in the extensions.xml file to: encoding="utf-8". Let me know if that doesn't solve the problem for you.
    -Genevieve Orchard (VSTS Database Edition Test Team)
    Tuesday, May 12, 2009 11:49 PM
  • The utf-8 encoding didn't make a difference.

    I have not installed the GDR version of Database Edition.
    Wednesday, May 13, 2009 2:50 PM
  • Hi David,

    When you open VS, do you see any error message in error list complaining loading extension failed?


    Thanks,


    Liangxiao Zhu
    Wednesday, May 13, 2009 6:21 PM
  • No--the "Error list" window has no error messages.
    Wednesday, May 13, 2009 7:49 PM
  • I think we've figured out what the problem is. Please try putting your .dll and extensions.xml files into the ...Microsoft Visual Studio 9.0\DBPro directory (instead of in the Extensions subdirectory). Let us know if that solves the issue.
    -Genevieve Orchard (VSTS Database Edition Test Team)
    Wednesday, May 13, 2009 11:14 PM
  • Further clarification:

    * The extensions.xml file should reside in the ...Microsoft Visual Studio 9.0\DBPro directory
    * The .dll file must either be put into the ...Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies directory or be GAC'd
    -Genevieve Orchard (VSTS Database Edition Test Team)
    • Marked as answer by David Mahaffy Thursday, May 14, 2009 8:08 PM
    Wednesday, May 13, 2009 11:56 PM
  • That did it, thanks!
    Thursday, May 14, 2009 8:08 PM
  • I have followed these instructions, and still Visual Studio will not display my custom generator in any drop down.  Is there anywhere I can see which extensions Visual Studio has found and loaded?
    Thursday, June 04, 2009 6:55 PM
  • I don't think there's anywhere you can see which extensions VS has loaded. A question about your generator: did you sign the assembly? If so, can you post the code of your generator and extensions.xml file here, and we can try to find the problem.
    -Genevieve Orchard (VSTS Database Edition Test Team)
    Thursday, June 04, 2009 8:58 PM