I am trying to use the TFSSnapin in PowerShell from C# code using System.Management.Automation from the PowerShell SDK, however I would like to compile it using "AnyCPU". When I try debugging it in any CPU I get the "No Plugins Registered" error, I try debugging it in x86 mode and it works just fine. Is there anyway to get the Plugins registered on x64 PowerShell so I can use AnyCPU? Or am I just out of luck?
Asked
Active
Viewed 1,244 times
3 Answers
5
No. And it can't be changed until TFS 2010 Beta 2 at earliest. See: Why is the TFS Powershell snapin marked 32-bit only?

Richard Berg
- 20,629
- 2
- 66
- 86
4
This is now possible
Execute the following line in your 64-bit PowerShell command prompt
copy
HKLM:\SOFTWARE\Wow6432Node\Microsoft\PowerShell\1\PowerShellSnapIns\Microsoft.TeamFoundation.PowerShell
HKLM:\SOFTWARE\Microsoft\PowerShell\1\PowerShellSnapIns\Microsoft.TeamFoundation.PowerShell
-r
Then add the PSSnapin for Microsoft.TeamFoundation.PowerShell
.
1
Make sure you run the 64-bit version of InstallUtil to install the snapin info to the 64-bit registry (not the Wow registry node). If you start a 64-bit Visual Studio Command Prompt, it should have the path configured to execute the 64-bit version of installutil.exe.

Keith Hill
- 194,368
- 42
- 353
- 369
-
I cannot use the 64 bit InstallUtil as it just says the dll is the incorrect format. It appears they only have 32 bit dll's so maybe I just cannot do it. – Alex Aug 20 '09 at 18:14
-
That's weird. We build the PSCX snapin as AnyCPU and I'm able to register it and use it in a 64-bit Powershell prompt. – Keith Hill Aug 20 '09 at 19:06
-
1The TFS snapin in the TFS PowerTools was built for x86 only. He's not recompiling the TFS PowerTools snapin. – Steven Murawski Aug 20 '09 at 19:43
-
Oh I misinterpreted. I thought he had source code for the snapin and was trying to do just that - recompile it to target Any CPU. Doh! – Keith Hill Aug 20 '09 at 22:06