开发者

Deploying Custom Policy on TFS2010 using VSIX and PKGDEF

开发者 https://www.devze.com 2023-01-20 12:29 出处:网络
I\'m having a hell of a time trying to get a custom policy to install on TFS2010 using VSIX. I have the policy up and running and working fine on my development PC, I have written a value to the regi

I'm having a hell of a time trying to get a custom policy to install on TFS2010 using VSIX.

I have the policy up and running and working fine on my development PC, I have written a value to the registry manually, and the policy is enforced.

The trouble is setting up a VSIX project and deployment to our other development machines.

I followed the instructions in:

http://blogs.msdn.com/b/jimlamb/archive/2010/03/31/how-to-implement-package-and-deploy-custom-check-in-policy-for-tfs-2010.aspx

The preferred method appears to be to use the new VSIX project type in VS 2010, I add a VSIX project to my solution, but the instructions in the blog entry are very vague about what to do next. My understanding is that the PKGDEF file means you do not have write a value to the registry when deploying, and the content of the PKGDEF file is rolled into the config when you start Visual Studio. That's fine, but how do you build up the VSIX package?

I tried adding the custom policy project to the VSIX project as a VS Package type, but when I build I get the error: The target "PkgdefProjectOutputGroup" does not exist in the project.

I have tried adding just the dll, the pkgdef file as a custom content type, etc, but nothing works.

I have changed the PKGDEF file in the blog to match my own project.

When I install the VSIX package on a development machine, I can see the add-in in the Extensions Manager in Visual Studio, but when I check the custom policies in TFS, I get the "is not registered" error.

I really need a step-by-step to setting 开发者_如何学Cup a VSIX project to deploy a custom policy, can anyone help?


The blog post definitely has a missing step. I think what the author intended was that you add the pkgdef file to the VSIX project (via the vsixmanifest editor) as Content of type VS Package. Then, add a project reference to the checkin policy project from your VSIX project (which will cause the checkin policy DLL to be added to your VSIX).

As a side note....when you pick "VS Package" as the content type and then point to a project...it needs to be a proper VS Package project (not just a vanilla C#/VB class library).


The problem is the assembly name "NArrange.CheckinPolicy.dll" does not match the name in the Policies.pkgdef. To correct this make sure that your Policies.pkgdef looks like this:

[$RootKey$\TeamFoundation\SourceControl\Checkin Policies]
"TeamFoundation.Samples.CheckinPolicies"="$PackageFolder$\NArrange.CheckinPolicy.dll"

Additionally I would avoid further confusion by changing the "Product Name" in source.extension.vsixmanifest to NArrange.CheckinPolicy. This way the assembly will match the product name in VS Extensions.

0

精彩评论

暂无评论...
验证码 换一张
取 消