Team blog of MCS @ Middle East and Africa

This blog is created by Microsoft MEA HQ near shoring team, and it aims to share knowledge with the IT community.With its infrastructure and development sides,It brings to you the proven best practices and real world experiences from Subject Matter Experts
Follow Us On Twitter! Subscribe To Our Blog! Contact Us

BizTalk Cop installation and configuration for VS 2012

BizTalk Cop installation and configuration for VS 2012

  • Comments 4
  • Likes

I faced a requirement today that I need to enable some BizTalk best practices and create a custom check-in policy for these practices while the developers are checking in code. While searching the internet I found the BizTalk Cop (which is a great tool) that does exactly that, but unfortunately this tool supports only Visual Studio 2010 and BizTalk 2010 and does not support BizTalk 2013 and visual studio 2012. So the challenge was how to enable this to work with Visual Studio 2012. Another challenge that I had was to create a default custom check-in policy and a rules set that is enabled by default on TFS that would only allow the developers to check-in their code if they enable this rule set.

The solution that I performed involved the following changes (updates)

    1. I copied the DLL “BizTalkCop.Rules.dll” to the folder “C:\Program Files (x86)\Microsoft Visual Studio 11.0\Team Tools\Static Analysis Tools\FxCop\Rules”
    2. I created a file called “BizTalkRules.ruleset” (attached at the end of this article) containing the set of rules that are enabled by default for the projects.
    3. I copied the file “BizTalkRules.ruleset” to the folder “C:\Program Files (x86)\Microsoft Visual Studio 11.0\Team Tools\Static Analysis Tools\Rule Sets”
    4. Changed the file “devenv.exe.config” in the folder “C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE” so that it redirects all FxCop dependencies from the 10.0 and 9.0 versions to the 11.0 version in the assembly binding section as follows:

<dependentAssembly>
  < assemblyIdentity name="FxCopCommon" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
  < bindingRedirect oldVersion="9.0.0.0" newVersion="11.0.0.0"/>
< /dependentAssembly>
< dependentAssembly>
  < assemblyIdentity name="FxCopSdk" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
  < bindingRedirect oldVersion="9.0.0.0" newVersion="11.0.0.0"/>
< /dependentAssembly>
< dependentAssembly>
  < assemblyIdentity name="Microsoft.Cci" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
  < bindingRedirect oldVersion="9.0.0.0" newVersion="11.0.0.0"/>
< /dependentAssembly>
< dependentAssembly>
  < assemblyIdentity name="Microsoft.VisualStudio.CodeAnalysis" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
  < bindingRedirect oldVersion="9.0.0.0" newVersion="11.0.0.0"/>
< /dependentAssembly>
< dependentAssembly>
  < assemblyIdentity name="Microsoft.VisualStudio.CodeAnalysis.Common" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
  < bindingRedirect oldVersion="9.0.0.0" newVersion="11.0.0.0"/>
< /dependentAssembly>
< dependentAssembly>
  < assemblyIdentity name="Microsoft.VisualStudio.CodeAnalysis.Interop" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
  < bindingRedirect oldVersion="9.0.0.0" newVersion="11.0.0.0"/>
< /dependentAssembly>

    1. Changed the file “FxCopCmd.exe.config” in the folder “C:\Program Files (x86)\Microsoft Visual Studio 11.0\Team Tools\Static Analysis Tools\FxCop” so that it redirects all FxCop dependencies from the 10.0 and 9.0 versions to the 11.0 version in the assembly binding section as follows:

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  < dependentAssembly>
    < assemblyIdentity name="FxCopCommon" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
    < bindingRedirect oldVersion="9.0.0.0" newVersion="11.0.0.0"/>
  </dependentAssembly>
  < dependentAssembly>
    < assemblyIdentity name="FxCopSdk" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
    < bindingRedirect oldVersion="9.0.0.0" newVersion="11.0.0.0"/>
  </dependentAssembly>
  < dependentAssembly>
    < assemblyIdentity name="Microsoft.Cci" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
    < bindingRedirect oldVersion="9.0.0.0" newVersion="11.0.0.0"/>
  </dependentAssembly>
  < dependentAssembly>
    < assemblyIdentity name="Microsoft.VisualStudio.CodeAnalysis" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
    < bindingRedirect oldVersion="9.0.0.0" newVersion="11.0.0.0"/>
  </dependentAssembly>
  < dependentAssembly>
    < assemblyIdentity name="Microsoft.VisualStudio.CodeAnalysis.Common" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
    < bindingRedirect oldVersion="9.0.0.0" newVersion="11.0.0.0"/>
  </dependentAssembly>
  < dependentAssembly>
    < assemblyIdentity name="Microsoft.VisualStudio.CodeAnalysis.Interop" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
    < bindingRedirect oldVersion="9.0.0.0" newVersion="11.0.0.0"/>
  </dependentAssembly>
< /assemblyBinding>

  1. Restart VS 2012
  2. I enabled a default check-in policy using the source control settings as per the below screen shoots
    image
    image
    image
    image
  3. Make sure you perform the same steps on the TFS Build server and all developer machines.

 

 

 

Happy coding :)

 

Attachment: http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-79-57-ContentFiles/2364.BizTalkRules.zip
Comments
  • Great story

  • Where BizTalkRules.ruleset file??

  • Where is BizTalkRules.ruleset file??

  • Sorry forgot the file. I have now updated the post.

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment