We have using TFS as version control. Currently the project management is done through our local PMS application. We have a requirement like when a team member check in the project, show a custom dialog for entering task details and update our local pms database. I want to show a custom dialog box that and/or after the check-in command is invoked. Also ensure that only successful submission of task details through this custom dialog boxes, we can checkin the projects.
相关问题
- How to know full paths to DLL's from .csproj f
- Importing NuGet references through a local project
- Visual Studio 2019 - error MSB8020: The build tool
- 'System.Threading.ThreadAbortException' in
- VS2017 RC - The following error occurred when tryi
相关文章
- How to show location of errors, references to memb
- How to track MongoDB requests from a console appli
- Visual Studio Hangs on Loading UI Library
- How to use Mercurial from Visual Studio 2010?
- Is it possible to do a “destroy history” in TFS?
- Copy different file to output directory for releas
- Edit & Continue doesn't work
- “Csc.exe” exited with code -1073741819
Custom checkin policy deployment
First create class library for custom checkin policy with your business logic
Deploy your check-in policies to customers using VSIX packages, which are easy to install.
You want to build your custom check-in policy for VS 2010, VS 2012, and VS 2013, then you’ll need a machine with all three of those Visual Studio versions installed side-by-side, and you’ll need the Visual Studio SDK installed for each one. The VSIX project template only available after successful installation of Visual Studio SDK.
Steps for creating check-in policies using VSIX packages in visual studio 2012 version
1.Create new project in visual studio 2012 version.
2.Select the Extensibility project template and choose the VSIX Project template.
You should add some items to the project like icon bitmap and License.txt, but only one of these is mandatory : “policies.pkgdef”
[$RootKey$\TeamFoundation\SourceControl\Checkin Policies] "TFSPMSIntegration"="$PackageFolder$\TFSPMSIntegration.dll"
Part 1: This is a name you choose to give your policy package, and which will be the name of the key in the registry Part 2: This is the assembly name as defined in the project properties, Application/Assembly name field.
Choose the Assets tab and add the “ policies.pkgdef” file using “Add new asset” window
You have to build the solution, and install the VSIX by double-clicking it. Note that it first takes effect when you restart Visual Studio.
*In order to disable and uninstall the package go to visual studio tools menu and choose “Extension and Updates “
Choose the extension and do the appropriate actions
Creating your own checkin policy
You can do this through a Check-in policy. Check out my blog post on interacting with the user on check-in. The basic trick is to raise a check-in warning which the user can click, on the click event, you can show UI to the user and use standard Windows Forms functionality to interact with your system.
The most basic example code can be found in this StackOverflow question.
My multiple Branch policy uses this trick to ask a user to confirm whether the user really wants to check in code to multiple branches at the same time without having to use the bypass policy validation checkbox.
A note on installing Checkin policies
After configuring the Team project to use the checkin policy, Visual Studio will complain when the policy is not installed on the machine upon checkin. There is no easy way to distribute checkin policies to ensure that every user has it installed on their machine, or will automatically get it installed from TFS.
In your checkin policy you can provide a URI to the location of the policy package through the
IPolicyDefinition.InstallationInstructions
. The package can be a.msi
, a.vsix
or just a zip file with a script to copy the assembly and add the required registry key. Visual Studio doesn't care about the method you choose. If your company hosts their own Visual Studio gallery, it could point to the download location there as well.If you pick an
.msi
you could have them distributed through existing provisioning tools that might be available in your organisation.Clients that do not have the policy installed will automatically trigger a warning on checkin that can only be dismissed by checking the "bypass checkin policy" checkbox. That permission can be revoked, requiring all users to setup their machine correctly.
There is one more way to distribute checkin policies, which is through the Visual Studio Power tools. By checkin in the policies in Source Control in a specific folder and telling the Power Tools to download custom binaries (work item controls and checkin polciies), they will be installed automatically. Since these tools are not installed by default, not configured by default they need about the same amount of work to make this scenario work for you.