TFS 2013 Best Practices Analyzer (BPA) fails with %TFSServerURLValidated% error

TFS 2013 Best Practices Analyzer (BPA) fails with %TFSServerURLValidated% error

Posted by richard | February 14, 2014 | Best Practice, TFS

Earlier this week I installed the Team Foundation Server 2013 Power Tools and went to run a BPA scan. It finished very quickly, giving me a couple of strange %TFSServerURLValidated% messages …

image

Viewing the report showed an additional warning “Cannot validate the URL provided”. I double-checked the spelling of my TFS URL, but it was fine. By selecting the “Other Reports” option, I was able to find the root cause …

image

So I began my research of the “Incorrect Windows PowerShell version 3.0. Windows PowerShell version 2.0 is supported in the current console.” error message and tried many things …

tempTried running BPA as Administrator (try the easy stuff first, right?)

tempCorrect versions of PowerShell were installed

tempPowerShell ExecutionPolicy was set to RemoteSigned

tempThe WinRM service was running and configured to support basic authentication

Still stumped, I reached out to some fellow Visual Studio ALM MVPs and Jason Stangroome gave me the answer, which I’m paraphrasing here …

“The error message is coming from within PowerShell. BPA is trying to add the “TfsBPAPowerShellSnapIn” snapin into the in-process PowerShell runspace but the snapin is reporting that it expects v3 of PowerShell whilst the BPA in-process runspace is hosting PSv2. On an OS with PowerShell v3 or later installed, switching between the two is performed by switching between CLR 2 and CLR 4. Checking the TFS BPA assemblies shows that they are compiled for CLR 2. So, either BPA needs to run under CLR 4, or the TfsBPAPowerShellSnapIn needs to report that it works with PSv2.”

Following Jason’s lead, I created a TfsBpa.exe.Config file in the C:\Program Files (x86)\Microsoft Team Foundation Server 2013 Power Tools\Best Practices Analyzer folder and added these lines to it to force the CLR 4 to be used …

<configuration>
 <startup>
  <supportedRuntime version="v4.0.30319"/>
 </startup>
</configuration>

BPA is working great now …

image

Blog Comments

Thanks for the fix! Works great.

Can’t we add this to the source code of BPA?

It only took about 10 months, but I got the quotes fixed. 🙂

Just ran into the same problem. But if you copy/paste your sample to a new config file, then it wont work due to some character encoding issues. The double quotes in your sample is not valid in a config file.

Thanks for saving me a bunch of time trying to run this down!

Thanks!

Leave a Reply to Anonymous Cancel Reply

*Please complete all fields correctly

Related Blogs

Posted by richard | September 28, 2017
Which tests are my regression tests?
Although we can't help you decide which tests should be part of your regression suite, we can help you easily identify them by using tags. Over the years, we've seen...
Posted by richard | September 30, 2016
Wassup Team Room?
According to Microsoft's official definition, Team Rooms, like chat rooms, "provide teams with a space to discuss work in progress, ask questions, share status, and clarify issues that arise." Sounds...
Posted by richard | August 15, 2016
Ordering the Product Backlog by ROI
The Scrum Guide says that the Product Owner is the sole person responsible for managing the Product Backlog and that Product Backlog management includes ordering items in the Product Backlog...