This guide assumes you have already downloaded all SocialTFS code. If not, please read the guide How to use Team Explorer with SocialTFS on Codeplex.

How to debug SocialTFS Client

Create a file named SocialTFSClient.addin in <User Documents>\Visual Studio 201x\Addins and copy the following code in it. Replace the 'x' with the number of your version, 0 for 2010, 1 for 2012, and 2 for 2013.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Extensibility xmlns="http://schemas.microsoft.com/AutomationExtensibility">
	<HostApplication>
		<Name>Microsoft Visual Studio Macros</Name>
		<Version>1x.0</Version>
	</HostApplication>
	<HostApplication>
		<Name>Microsoft Visual Studio</Name>
		<Version>1x.0</Version>
	</HostApplication>
	<Addin>
		<FriendlyName>SocliacTFS Client</FriendlyName>
		<Description>SocliacTFS Client is a part of SocialTFS project</Description>
		<Assembly>[DLL Path]\It.Uniba.Di.Cdg.SocialTfs.Client.dll</Assembly>
		<FullClassName>It.Uniba.Di.Cdg.SocialTfs.Client.Connect</FullClassName>
		<LoadBehavior>1</LoadBehavior>
		<CommandPreload>1</CommandPreload>
		<CommandLineSafe>0</CommandLineSafe>
	</Addin>
</Extensibility>


Replace [DLL Path ] (Inside <Assembly>) with the local path of It.Uniba.Di.Cdg.SocialTfs.Client.dll generated by your local project.
For a complete guide of all tags, visit http://msdn.microsoft.com/en-us/library/19dax6cz(v=vs.80).aspx.

At this point, the debug should works correctly. If the new instance of Visual Studio with the addin does not start, Click on project → Menu → Project → <Project-Name> Properties... → Debug and set all properties for your specific machine such as in the following image:

ProjectProperties.jpg

(Command line arguments: "/resetaddin It.Uniba.Di.Cdg.SocialTfs.Client.Connect")

Note that if the AddIn is loaded in your main instance of Visual Studio, you can not build or run the AddIn because the resource is locked. To avoid this:

  1. Close all Visual Studio instances;
  2. Open the file SocialTFSClient.addin in <User Documents>\Visual Studio 2010\Addins;
  3. Change <LoadBehavior>1</LoadBehavior> in <LoadBehavior>0</LoadBehavior> and save;
  4. Open your main Visual Studio instance;
  5. Chage <LoadBehavior>0</LoadBehavior> in <LoadBehavior>1</LoadBehavior> and save;
  6. Build and run the AddIn project.

Alternative procedure to make the Debug working

If Debug is still not working, please follow these steps:

  1. Close VS
  2. Set LoadBehavior to 0 in the previous XML file.
  3. Go to SocialTFS root dir and delete all files in bin/Debug, bin/Release, obj/Debug and obj/Release of the following dirs: It.Uniba.Di.Cdg.SocialTfs.Client and It.Uniba.Di.Cdg.SocialTfs.SharedLibrary
  4. Open VS
  5. Select and recompile the Client and SharedLibrary projects.
  6. Find these files in bin/Debug of the corresponding dirs: It.Uniba.Di.Cdg.SocialTfs.Client.dll and It.Uniba.Di.Cdg.SocialTfs.SharedLibrary.dll and copy & paste them to <User Documents>\Visual Studio 201x\Addins\SocialTFS
  7. Run the project in Debug mode.

Troubleshooting

Note that you might have to change the encoding from UTF-16 to the type you're actually using for editing the addin file. VS will protest at startup about encoding mismatch, otherwise.

 

Last edited Nov 7, 2014 at 4:26 PM by fcalefato, version 16