-
Notifications
You must be signed in to change notification settings - Fork 718
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
not working with vs 2012 if checkin policy exists #258
Comments
This is usually caused by version mismatches. For example, if the checkin policy installed is for VS2010, but git-tfs finds VS2012, then the 2012 client lib won't be able to load the checkin policy. Which versions of VS / Team Explorer do you have installed? Which versions of TFS power tools do you have installed? Which one do you use to access TFS? Which version of TFS is git-tfs using ( |
@Jiyuu I had the same problem after installing VS2012. Tell git-tfs to use 2010 client by setting environment variable GIT_TFS_VERSION to 2010. |
I forgot to mention but if I set --force then the commit works, but when looking at the changeset it shows the error mentioned above as a policy issue.. @spraints this is the output of git tfs info
the version im using is the version I took last night from here on git hub and built. I only compiled and used the V11 version though as I don't actually have VS2010 on this pc and it failed compilation. the TFS server is indeed TFS2010 , and as mentioned the VS version I have is 2012. using visual studio 2012 though I have no issues committing to the tfs server so it sounds strange to be related to this.. when I use the "checkintool" command it loads the form ok but simply shows the same issue which I quoted above @kgybels sorry if I misunderstood.. |
@Jiyuu Sorry my bad, it is GIT_TFS_CLIENT, not GIT_TFS_VERSION. |
We are a lot to have this problem. Shouldn't we add the solution in the wiki? Create a page "common problems"? |
@kgybels do I need to restart something after setting that env var? |
@Jiyuu Yes, after setting the environment variable in windows, you need to restart your git command prompt. If it is set correctly, then git tfs info should show the TFS client library version as 10.0.0.0. |
@kgybels now I get the following error C:>git tfs info I don't seem to have that dll.. |
IIRC at a minimum you need to install Team Explorer 2010. Cheers,
|
@Jiyuu I had another look at this and here is what I found: The Changeset Comments Policy that is causing the problem used to be provided by the TFS 2010 Power Tools, implemented as CheckForCommentsPolicy.CheckForComments in the Microsoft.TeamFoundation.PowerTools.CheckinPolicies.ChangesetComments assembly [1]. This policy, however, is now provided directly with VS2012 in the Microsoft.TeamFoundation.VersionControl.Controls assembly [2][3][4]. I also found out that these policy plugins are registered at: However, for Microsoft.TeamFoundation.VersionControl.Controls, it is set to an empty path, VS must have some other means of loading the correct assembly. Thankfully, you can change that registry key to the full path of the assembly and it will then work with git-tfs! Of course, I also did a quick test to see if it doesn't break VS. [1] C:\Program Files (x86)\Microsoft Team Foundation Server 2010 Power Tools\Check-in Policy Pack\Microsoft.TeamFoundation.PowerTools.CheckinPolicies.ChangesetComments.dll |
so just to clarify in case this happenes to someone else, as when i read the responses i was not 100% sure about what to do. in order for "GIT_TFS_CLIENT" environmental variable to function i had to install team explorer 2010. after that what i did was to set the value of the "Microsoft.TeamFoundation.VersionControl.Controls" in the [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\11.0\TeamFoundation\SourceControl\Checkin Policies] registry to after doing that both the checkintool(for 2010, and for 2012) and the command line tool worked properly. so from the look of things it would seem like the only thing really needed was the registry edit, the rest are not required. |
Sorry about the hassle, but I'm happy to hear that you were able to resolve the problem. |
Now that I'm writing about this in the wiki, I wonder if this is a 32 vs 64-bit thing? @Jiyuu, is your Windows 64-bit? If VS is also running in 64-bit mode, it is going to use a different registry than git-tfs, which always runs in 32-bit mode. Git-tfs is 32-bit (x86) because the VS2008 version of TFS is also x86, and git-tfs still supports that. When we drop support for VS2008, git-tfs should be able to switch to "Any CPU", which should solve this problem. If you want to try it out, the current master version of |
my windows is 64 bit, the visual studio instances im running are running as 32bit though, i will try compiling as you suggested( i assume that you want me to undo the registry edit as well) and report the results later.. |
Yeah, that's what I'm curious about. If VS is running as 32-bit, then maybe On Thu, Dec 20, 2012 at 5:54 PM, Dror Levy notifications@github.com wrote:
|
Just to add some more information to this bug. I was contacted by Philip Kelley from the Microsoft TFS team when I experienced a similar problem. It turned out that it is probably caused by a bug in the TFS installer - because the check-in policies are registered with partial names only. Philip's suggested fix for this is:
|
@flcdrg I tried it today and using the strong names works too, thanks! |
@flcdrg Thanks! |
Tried the Registry update hack today. It worked. |
That make me think that we have a doc on this problem and never give the link : https://github.com/git-tfs/git-tfs/blob/master/doc/troubleshooting-checkin-policies.md#the-checkin-policies-need-to-be-registered |
everything seems to work fine except for the checkin process which fails for the following reason
[ERROR] Policy: Internal error in Changeset Comments Policy. Error loading the Changeset Comments Policy policy (The pol
icy assembly 'Microsoft.TeamFoundation.PowerTools.CheckinPolicies.ChangesetComments, Version=10.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a' is not registered.). Installation instructions: To install this policy, follow the inst
ructions in CheckForComments.cs.
seem to have a ref to vs2010 somewhere which I couldn't find..
The text was updated successfully, but these errors were encountered: