Database Projects?

Feb 9, 2011 at 8:00 PM
Edited Feb 9, 2011 at 8:00 PM

I just installed this (VS 2010) and doesn't appear to be working with database projects?  I can see the Right-Click context menu with .cs files but not with .sql files.  Is this correct?  Is there a workaround for this?

Coordinator
Feb 10, 2011 at 4:29 AM

I just checked at my site, tried a VS2008 project with a .sql file. TeamReview works with that.

Created a VS2010 database project, right click on a .sql file and I see the TeamReview context menu's.

Not sure what is happening at your site.

Things to check:-

Save the solution into source control, close the solution, re-open the solution and try the TeamReview context menus again.

Check the installation folder for any exceptions in the .log file if it exists (C:\Program Files\TeamReview\TeamReview (2010))

Feb 10, 2011 at 7:09 PM

Thanks bluess57,

The log file doesn't exist in the specified location.

I tried uninstalling/reinstalling and still when I highlight a section of code and right-click, TeamReview does not appear in the menu.

 

Very strange

Feb 16, 2011 at 6:09 PM

I am having the same issue (below). Has anyone found a fix or workaround for this?

  • in VS 2010 Team Review context menu only shows up for .NET code, not SQL files
  • in VS 2008 Team Review context menu shows up for all code (except ASHX)

 

Coordinator
Feb 16, 2011 at 10:05 PM

Please send me a complete VS2010 solution with projects if you can.

Feb 17, 2011 at 1:51 AM
Edited Feb 17, 2011 at 3:56 PM

Bluess57,

We have our SQL as files in TFS, not within a solution. If the team project does not have a solution in it, we just create one so that we can open up the solution to use Team Review. 

Therefore, I am not sure sending you files will help.

Repro Steps would be:

1) create a team project in TFS 2010 (though I have only tested with team projects we migrated from TFS 2008)

2) add .SQL files to source control under the team project

3) create a VS 2010 solution (I just created console app)

4) open up the VS 2010 solution

5a) open up the .CS in the solution - team review will be available

5b) open up the SQL in the source control for the team project - team review is not available

Dave

May 16, 2011 at 4:55 PM
bluess57 wrote:

Please send me a complete VS2010 solution with projects if you can.

 

Bluess57,

We were able to fix this problem in VS 2010 by changing code. The reasons we cannot see the Team Review context menu in SQL Editor include:

  1.  Our Visual Studio 2010 has two SQL Editor Context Menu command bars (maybe others only have one SQL Editor Context Menu command bar, still not sure why we have two SQL Editor Context Menu command bars)
  2. In our case, our SQL Editor is associating with second context menu, so we cannot see the Team Review context menu when we try to review the SQL scripts

The minor code changes are located in Connect.cs file in TeamReview.VSNetAddIn project, Please see below changes:

 

                  private void BuildMenu()
        {
            CommandBars bars = shellDTE.CommandBars as CommandBars;
            if (bars == null)
                return;


            foreach (string menu in menus)
            {
                try
                {
                     // Below is my minor change
                     // Iterate all command bar and add TeamReview context menu to all Sql Editor Context Menu, Code Window, ASPX Context, CSSSource …
                     // In previous codes, only add the TeamReview context menu to first matched command bar
                    foreach (CommandBar bar in bars)
                    {
                        if (bar.Name.Equals(menu, StringComparison.OrdinalIgnoreCase))
                        {
                            //add the popup menu
                            CommandBarPopup teamReviewPopup = AddPopup(bar, Constants.COMMAND_BAR_CAPTION);

                            //add sub menus
                            CommandBarEvents newWorkItemEvent = CreateButtonEvents(teamReviewPopup, Constants.MENU_NEW_CODE_REVIEW_ITEM_LABEL, 1);
                            CommandBarEvents showReplayEvent = CreateButtonEvents(teamReviewPopup, Constants.MENU_OPEN_REVIEW_REPLAY_LABEL, 2);

                            // Now that we have added the menu items associate their click events
                            newWorkItemEvent.Click +=
                                new _dispCommandBarControlEvents_ClickEventHandler(ShowAddCodeReviewItemEventHandler);
                            showReplayEvent.Click +=
                                new _dispCommandBarControlEvents_ClickEventHandler(ShowReplayEventHandler);

                            //Every command bar menu event is required in this list to keep alive our event click handlers
                            commandEventList.Add(newWorkItemEvent);
                            commandEventList.Add(showReplayEvent);
                        }
                    }
                }
                catch (System.ArgumentException)
                {
                    Instrumentation.Trace(String.Format("Menu '{0}' does not exist in this Visual Studio installation.", menu));
                }
                catch (System.NullReferenceException)
                {
                    Instrumentation.Trace(String.Format("Menu '{0}' does not support TeamReview, this may be from another add-in.", menu));
                }
            }
        }

 

HTH,

Dave