سؤال

I have custom check-in policies deploying via VSIX. Now I'm trying to use them in Visual Studio 2013.

What I did: I opened my policies in VS 2013. Changed "Install Targets" in vsixmanifest to [10.0, 13.0). Then built project, installed VSIX and opened both VS.

VSIX project uses .NET Framework 4.5, policies project uses 4.0.

What I have:

  • Last version of my policies in C:\Users\...\AppData\Local\Microsoft\VisualStudio\12.0Exp\Extensions directory
  • Copies of policies for both 2012 and 2013 VS in C:\Users\...\AppData\Local\Microsoft\VisualStudio\11.0(and 12.0)\Extensions
  • Key with path to policies in registry for both VS in HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0_Config(and 12.0_Config)\TeamFoundation\SourceControl\Checkin Policies

Now, when I want to apply them in Team Project Settings -> Source Control -> Check-in Policy -> Add, I can choose my custom policies in VS 2012, but VS 2013 just doesn't see them.

What can I do to fix it?

UPD:

So, I solved my problem by changing assembly version of Microsoft.TeamFoundation.VersionControl.Client from 11.0 to 12.0 AND .NET Framework version in policies project from 4.0 to 4.5

هل كانت مفيدة؟

المحلول

As the Original Poster has posted, the version of .NET and of the referenced Client Object Model:

  • For Visual Studio 2005, you need to reference the 8.0.0.0 assemblies and your project must be an AnyCPU .NET 2.0 project.
  • For Visual Studio 2008, you need to reference the 9.0.0.0 assemblies and your project must be an AnyCPU .NET 3.0 project.
  • For Visual Studio 2010, you need to reference the 10.0.0.0 assemblies and your project must be an AnyCPU .NET 4.0 project.
  • For Visual Studio 2012, you need to reference the 11.0.0.0 assemblies and your project must be an AnyCPU .NET 4.0 project.
  • For Visual Studio 2013, you need to reference the 12.0.0.0 assemblies and your project must be an AnyCPU .NET 4.5 project.
  • For Visual Studio 2015, you need to reference the 14.0.0.0 assemblies and your project must be an AnyCPU .NET 4.6 project.

If you have multiple versions of Visual Studio installed, you need to deploy the assembly multiple times, once for each version of Visual Studio. These assemblies must have the same AssemblyName and the same AssemblyVersion and be signed with the same strong name.

The policies must each be registered in the registry under the following keys:

  • HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\{VisualStudioVersion}\TeamFoundation\SourceControl\Checkin Policies
  • HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\{VisualStudioVersion}\TeamFoundation\SourceControl\Checkin Policies (64 bit OS only)
  • HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\{VisualStudioVersion}_Config\TeamFoundation\SourceControl\Checkin Policies (should be added automatically by running devenv /setup)

A more extensive walkthrough can be found on my blog.

نصائح أخرى

I had the same problem, a custom policy working on VS 2008/2010 don't install correctly in vs2013. Finally I opened the custom policy project in VS 2013, then I readded Microsoft.TeamFoundation.VersionControl.Client reference and compile it. Now it works and recognize as the same policy that VS2010.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top