Archives / 2004 / November
  • CodeShare Addin for Visual Studio.NET

    [ CodeShare Addin updated for Visual Studio 2005

    [ Now share source code from any application ]: With this new plugin and setup instruction, you can share source code from websites into a central database and insert them into VS.NET using the same interface.
    See screen shots and download the plugin
    Read these instructions to contribute code from any application


    CodeShare Addin is a Visual Studio.NET plugin for sharing code snippets in an enterprise. It provides menu options within the IDE to contribute and find code snippets from a central repository.

    After downloading and extracting the files from the zip package, you'll get the following three folders.
     a) Database: You'll find the database script here.
     b) CodeShareService: The Web service to setup on Server. You can change the Connection String in web.config .
     c) CodeShareAddin: The setup for CodeShare addin. 

    There are two steps to install Codeshare Addin.

    Server Setup:
     1. Create the database and other necessary entities by executing the codeshare_sql.sql file in the Database folder.
     2. Setup the CodeShareService folder as virtual directory.
    Client Setup:
     1. Run the Setup.exe from the CodeShareAddin directory to install the addin and then start Visual Studio.NET IDE to complete the configuration. When you start Visual Studio.NET after installation, you'll notice the following dialog box to specify the URL of the Web service created in "Server Setup".

    How It Works:
    After completing the setup, you'll see two new options in the context menu of the Code Window

    "Contribute Code":
     To share a piece of code snippet, select the appropriate code and press "Contribute Code" on the context menu.

     It will open the following dialog box with your selected code.

     1) If you would like to edit the web service URL then you can do so by putting the new URL in the text box and press "Save" to update it into the registry.
     2) Specify appropriate keywords to correctly index your source code snippet.
     3) The source code you selected from within the IDE. You can also edit the source code here.
     4) Your name, by default it takes the name of current logged in User. You can change it here to update profile.
     5) Submit button saves the snippet into the database.
    "Find Code":
     To find a piece of code, go to the place where you need to insert the code and then select "Find Code" from the context menu.

     Selecting this option will open up the following dialog box:

     1) If you would like to edit the web service URL then you can do so by putting the new URL in the text box and press "Save" to update it into the registry.
     2) Keywords to search code snippets.
     3) A list box to display results.
     4) To display code for the selected item in the list box.
     5) Filter the list to only show snippets posted by you.
     6) Insert the selected code into the IDE

    Try these after installation:

    1 - Check whether the addin is successfully registered with Visual Studio.NET by examining the following registry entry


    If you can't find this entry then follow step 2.

    Otherwise, open Visual Studio.NET, goto Tools->Add-in Manager and confirm that you have "Enterprise Code Sharing" in that list. Then close the IDE and run the following registry file.

    ReCreateCommands.reg.txt (Remove the trailing .txt before merging)

    After merging the registry entries, try to re-open the IDE.
    If still not successful then re-install the Addin and follow step 1 again.

    2. Run the following registry file and re-open the IDE. If the problem persists, follow step 1.

    codeshare.reg.txt (Remove the trailing .txt before merging)

    Please provide your feedback and suggestions here.

    If you like this then you might like my other Projects