tfs 2013 custom checkin policy is not visible - visual-studio

I'm trying to create a custom checkin policy in TFS 2013. Followed this example and I create WorkitemStateControlPolicy class below
https://blog.devart.com/creating-tfs-custom-check-in-policy.html
namespace WIStateControlPolicy
{
[Serializable]
public sealed class WorkitemStateControlPolicy : PolicyBase
{
[NonSerialized]
private IPendingCheckin pendingCheckin;
public const string ClosedStatus = "System.Reason";
........
........
}
}
I build this project, WorkitemStateControl.dll created. Registy key I am using:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\14.0_Config\TeamFoundation\SourceControl\Checkin Policies]
"WorkitemStateControl"="c:\\Users\\me\\Desktop\\dll\\WorkitemStateControl.dll"
Then I checked the visual studio 2015 add checkin policy but new policy is not visible in list
I tried also this registy path:
(HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\11.0\TeamFoundation\SourceControl\CheckinPolicies)
But problem not changed.
My queston is, why new checkin policy is not visible? Should I change anything on tfs server?

There is not really a concept of a Check-in policy to go hand-hand with a version of Team Foundation Server. Instead these are plugins for Visual Studio. So you'rn buiding a plugin for that specific version of Visual Studio that happens to connect to a Team Foundation Server.
A such, each version of Visual Studio needs its own versions of the assemblies, compiled against the correct version of .NET and the correct version of the Team Foundation Server Client Object Model that matches the version that ships with the Team Explorer "extension" for Visual Studio.
You then register a different path to the specific assembly containing the policy into each registry tree of the version of Visual Studio you support. Ohh and don't forget to register the x86 and the x64 registry trees :).
Windows Registry Editor Version 5.00
//v12
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\12.0\TeamFoundation\SourceControl\Checkin Policies]
"JesseHouwing.CheckinPolicies"="C:\Program Files(x86)\\MyCompany\\Checkin Policies\\v12.0\\JesseHouwing.CheckinPolicies.dll"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\12.0\TeamFoundation\SourceControl\Checkin Policies]
"JesseHouwing.CheckinPolicies"="C:\Program Files(x86)\\MyCompany\\Checkin Policies\\v12.0\\JesseHouwing.CheckinPolicies.dll"
//v14
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0\TeamFoundation\SourceControl\Checkin Policies]
"JesseHouwing.CheckinPolicies"="C:\Program Files(x86)\\MyCompany\\Checkin Policies\\v14.0\\JesseHouwing.CheckinPolicies.dll"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\14.0\TeamFoundation\SourceControl\Checkin Policies]
"JesseHouwing.CheckinPolicies"="C:\Program Files(x86)\\MyCompany\\Checkin Policies\\v14.0\\JesseHouwing.CheckinPolicies.dll"
etc...
All the details are in this blog post.
VISUAL STUDIO PROJECT TYPE CPU .NET VERSION TFS OM VERSION VISUAL STUDIO VERSION
2017 Class Library AnyCPU 4.6 15.0.0.0 v15.0
2015 Class Library AnyCPU 4.6 14.0.0.0 v14.0
2013 Class Library AnyCPU 4.5 12.0.0.0 v12.0
2012 Class Library AnyCPU 4.0 11.0.0.0 v11.0
2010 Class Library AnyCPU 4.0 10.0.0.0 v10.0
2008 Class Library AnyCPU 3.0 9.0.0.0 v9.0
2005 Class Library AnyCPU 2.0 8.0.0.0 v8.0
And a sample project that targets multiple Visual Studio Versions.
In this project I've manually tweaked the project files to dynamically reference the version of the Client Object Model depending on the selected Visual Studio version using a choose/when construct:
<Choose>
<When Condition="'$(Configuration)' == 'VS2013'">
<ItemGroup>
<Reference Include="Microsoft.TeamFoundation.VersionControl.Client, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.TeamFoundation.Client, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.TeamFoundation, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
</ItemGroup>
</When>
<When Condition="'$(Configuration)' == 'VS2012'">
<ItemGroup>
<Reference Include="Microsoft.TeamFoundation.VersionControl.Client, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.TeamFoundation.Client, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.TeamFoundation, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
</ItemGroup>
</When>
<When Condition="'$(Configuration)' == 'VS2010'">
<ItemGroup>
<Reference Include="Microsoft.TeamFoundation.VersionControl.Client, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.TeamFoundation.Client, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.TeamFoundation, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
</ItemGroup>
</When>
<Otherwise>
<ItemGroup>
<Reference Include="Microsoft.TeamFoundation.VersionControl.Client, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.TeamFoundation.Client, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.TeamFoundation, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
</ItemGroup>
</Otherwise>
</Choose>
You can use similar tricks to reference different NuGet versions for later versions of Team Explorer. The TFS Aggregator project is built against every version of the Client Object Model since 2013 and we dynamically include a targets file to setup the references and nuget dependencies.

Related

Loading VS2015 solution in VS2017, coded UI test references are not found

I opened our solution in Visual Studio 2017 but some testing references aren't found, specifically:
Microsoft.VisualStudio.QualityTools.CodedUITestFramework
Microsoft.VisualStudio.TestTools.UITest.Common
Microsoft.VisualStudio.TestTools.UITesting
Opening under VS2015 they load fine and I can see the references under the Visual Studio 2015 folder structure "Microsoft Visual Studio 14.0\Common7\IDE\PublicAssemblies\".
However they don't appear under the 2017 installed files: "\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\PublicAssemblies\".
How can I get VS to pick up these references, am I missing a plug-in or extension? Have they been consolidated or deprecated?
Microsoft Visual Studio Enterprise 2017
Version 15.0.26228.4 D15RTWSVC
Microsoft .NET Framework
Version 4.6.01055
If you are running VS 2017 Enterprise then you can use this solution to add Coded UI Test back.
https://stackoverflow.com/a/42788766/2563765
If you want to remove those references in your project because you are not using Coded UI Test anymore, you can
1) Unload your project
2) Edit the .csproj file
3) Find
<IsCodedUITest>True</IsCodedUITest>
<TestProjectType>CodedUITest</TestProjectType>
and repleace with
<IsCodedUITest>False</IsCodedUITest>
<TestProjectType>UnitTest</TestProjectType>
4) Remove
<Choose>
<When Condition="'$(VisualStudioVersion)' == '10.0' Or '$(VisualStudioVersion)' == '11.0'">
<ItemGroup>
<Reference Include="UIAutomationTypes" />
</ItemGroup>
</When>
</Choose>
and
<Choose>
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
</ItemGroup>
</When>
</Choose>
if found
5) Reload the project

Visual Studio 2010 - vsix wizard extension cannot load referenced assembly

I use VSIX wizard extension.
Everything is functioning for one assembly. But when I want to have WizardAssemblyDetail (for DetailForm) and WizardAssemblyView (for ViewForm) and one assembly referenced from the other two (for ex. WizardAssemblyBase).
When I export it with a wizard, I cannot run the wizard because of "Could not load file or assembly 'WizardAssemblyBase' or one of its dependencies."
I tells that the WizardAssemblyBase.dll is not copied.
Is there a way how to solve it? Or some workaround?
Thanks in advance
You should add your Assemblies References in the Assets elements of your .vsixmanifest file.
In PackageManifest add :
<Assets>
<Asset Type="Microsoft.VisualStudio.ProjectTemplate" Path="ProjectTemplates" />
<Asset Type="Microsoft.VisualStudio.Assembly" Path="TemplateWizard\YourTemplateWizard.dll" AssemblyName="YourTemplateWizard, Version=1.0.0.0, Culture=neutral, PublicKeyToken=4dbd4c10d49bc550" />
<Asset Type="Microsoft.VisualStudio.Assembly" Path="TemplateWizard\NuGet.Core.dll" AssemblyName="NuGet.Core, Version=2.8.50506.491, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<Asset Type="Microsoft.VisualStudio.Assembly" Path="TemplateWizard\Microsoft.Web.XmlTransform.dll" AssemblyName="Microsoft.Web.XmlTransform, Version=2.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</Assets>

ReportViewer 11 (2012) Visual Studio 2010

I am using Visual Studio 2010 and I installed "Microsoft Report Viewer 2012 Runtime" hoping to test the new reporting system in SQL 2012. After which I cleared for ref to "Microsoft.ReportViewer.WebForms" from my Web.config and removed the ReportViewer control from my toolbox and added the new version 11 ReportViewer.
I added the new control to a testing page and for one it adds this register to the test page:
<%# Register Assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
and it adds these entry to the Web.config:
<buildProviders>
<add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</buildProviders>
<httpHandlers>
<add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false" />
</httpHandlers>
<handlers>
<add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</handlers>
The control in the toolbox is the version 11 addition but the system keeps trying to ref the verion 10 edition. Also when I try to compile it I get the error:
The type 'Microsoft.Reporting.WebForms.ReportViewer' exists in both 'c:\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.WebForms\10.0.0.0__b03f5f7f11d50a3a\Microsoft.ReportViewer.WebForms.dll' and 'c:\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.WebForms\11.0.0.0__89845dcd8080cc91\Microsoft.ReportViewer.WebForms.DLL'
I think I had the exact same problem. If so, my solution was to delete all entries in web.config referencing ReportViewer, then do the same in References, build the project and then re-ADD a reportviewer in the page.
web.config will update with new handlers and assemblies for the newer version.
I had the same error, and resolved it by doing the following:
In the aspx page (HTML code), updated the #Register Version value to correspond to the version of the assembly I was using, and updated the PublicKeyToken value with the correct value for the assembly.
In your web config, it means you have specified both v 10 and 11 dlls. Remove one or the other.
I have removed the following entry from package.config and it works
<package id="MicrosoftReportViewerWebForms_v10" version="1.0.0" targetFramework="net45" />

<HintPath> in *.csproj file doesn't work for VS2012

The following CodedUI Dlls are shipped with VS2012. What I did was just copy them to a separate folder and reference them from there. I checked the *.csproj file, it has the correct info as below. But in VS2012 property window, I checked the reference path, they are STILL resolved the default locations like "D:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\ReferenceAssemblies\v4.0\Microsoft.VisualStudio.QualityTools.CodedUITestFramework.dll"
The works for only one of the following DLLs, the "Microsoft.VisualStudio.QualityTools.UnitTestFramework". But I don't see anything different between how this DLL is referenced and the others.
WTF is this happening?
I see some other guy reported a bug about VS 2012 assembly binding.(http://social.msdn.microsoft.com/Forums/en/vsunittest/thread/ba271f86-ed33-49a5-9b52-99980e88d198)
But I am using the RTM version!
<Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Microsoft.VisualStudio.QualityTools.CodedUITestFramework.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Microsoft.VisualStudio.TestTools.UITest.Common.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Microsoft.VisualStudio.TestTools.UITest.Extension.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Microsoft.VisualStudio.TestTools.UITesting.dll</HintPath>
</Reference>
A ticket has been submitted to MS Connect: https://connect.microsoft.com/VisualStudio/feedback/details/758647/hintpath-in-csproj-file-doesnt-work-for-vs2012

Why does my co-worker see a different Project file (*.csproj) using Visual Source Safe

I met a problem which is very strange, my company uses Visual Source Safe
to control version,but I found that my team's different member see the same .csproj file in VSS is not the same, it's very strange,can you help me? thanks!!
there is a file named IPRA.WinUi.Sal.Sra.csproj in VSS:
when Tom log on ,the file 'IPRA.WinUi.Sal.Sra.csproj' is :
<Reference Include="Ark.Client.WinUi, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\ARAF\BusinessFramework\Ark.Client.WinUi.dll</HintPath>
</Reference>
<Reference Include="Ark.Common.Business, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL" />
<Reference Include="Ark.Controls.Business, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\ARAF\SystemFramework\Ark.Controls.Business.dll</HintPath>
</Reference>
But when leo log on,the same file 'IPRA.WinUi.Sal.Sra.csproj' is :
<Reference Include="Ark.Client.WinUi, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\ARAF\BusinessFramework\Ark.Client.WinUi.dll</HintPath>
</Reference>
<Reference Include="Ark.Common.Business, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL" />
<SpecificVersion>False</SpecificVersion>
<HintPath>..\ARAF\BusinessFramework\Ark.Controls.WinUi.dll</HintPath>
<Reference Include="Ark.Controls.Business, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\ARAF\SystemFramework\Ark.Controls.Business.dll</HintPath>
</Reference>
He needs to do a get latest, try build tree option to get to your development folder. He might be getting files to the wrong folder, thus his files are not updated. Try verifying your working folder is set correctly.
but I found that my team's different
member see the same .csproj file in
VSS is not the same,
Team see the same cs project? Then wats the issue?
If the team is seeing different file then the other person has not checked in or you are not using the latest version. Always try to checkin when you leave and get the latest version when you start your work.

Resources