BizTalk Cop installation and configuration for VS 2012


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 🙂

 

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

Comments (6)

  1. Anonymous says:

    Great story

  2. hassan sayed issa20014 says:

    thank you

  3. Abhishek says:

    Where BizTalkRules.ruleset file??

  4. Abhishek says:

    Where is BizTalkRules.ruleset file??

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

  6. showbox says:

    Thanks for the great info. I really loved this. I would like to apprentice at the same time as you amend your web site, how could i subscribe for a blog site?
    For more info on showbox please refer below sites:
    http://showboxandroids.com/showbox-apk/
    http://showboxappandroid.com/
    Latest version of Showbox App download for all android smart phones and tablets.
    http://movieboxappdownloads.com/ – It’s just 2 MB file you can easily get it on your android device without much trouble. Showbox app was well designed application for android to watch movies and TV shows, Cartoons and many more such things on your smartphone.
    For showbox on iOS (iPhone/iPad), please read below articles:
    http://showboxappk.com/showbox-for-ipad-download/
    http://showboxappk.com/showbox-for-iphone/
    Showbox for PC articles:
    http://showboxandroids.com/showbox-for-pc/
    http://showboxappandroid.com/showbox-for-pc-download/
    http://showboxforpcs.com/
    There are countless for PC clients as it is essentially easy to understand, simple to introduce, gives continuous administration, effectively reasonable. it is accessible at completely free of expense i.e., there will be no establishment charges and after establishment
    it doesn’t charge cash for watching films and recordings. Not simply watching, it likewise offers alternative to download recordings and motion pictures. The accompanying are the strides that are to be taken after to introduce Showbox application on Android.
    The above all else thing to be done is, go to the Security Settings on your Android telephone, Scroll down and tap on ‘Obscure sources’.