Locked Can't execute Get-TfsServer -All on Windows 2008

  • 17 กุมภาพันธ์ 2554 19:58
     
     

    I am not able to run the TFS PowerShell tools on my Windows 2008 instance. I get "The located assembly's manifest definition does not match...". I have ensured that I'm operating in a 32 bit session of PowerShell. I have the September 2010 version of the PowerTools. What could the problem be?

    PS C:\Users\JCorbei> Get-PSSnapin -Registered | where {$_.Name -like '*Foundation*'} | Add-PSSnapin
    PS C:\Users\JCorbei> Get-TfsServer -Name tfs


    Name                            : http://tfs:8080/
    CatalogNode                     :
    ConfigurationServer             :
    Uri                             : http://tfs:8080/
    TimeZone                        : System.CurrentSystemTimeZone
    InstanceId                      : 59692d32-adc2-496d-923d-a28ee795c53e
    Credentials                     : System.Net.SystemNetworkCredential
    Culture                         : en-US
    SessionId                       : d2b69fd5-cbbb-4c37-b93c-44525d817039
    ClientCacheDirectoryForInstance : C:\Users\JCorbei\AppData\Local\Microsoft\Team Foundation\3.0\Cache\59692d32-adc2-496d
                                      -923d-a28ee795c53e_http
    AuthorizedIdentity              : TeamFoundationIdentity instance 17138084
                                        Descriptor: IdentityDescriptor instance 41677152
                                        IdentityType: System.Security.Principal.WindowsIdentity
                                        Identifier: S-1-5-21-4161145231-3256545308-3565119146-50516

                                        DisplayName: Corbeil, Jessie
                                        AttributesSet: [0]
                                        IsContainer: False
                                        IsActive: True
                                        TeamFoundationId: 00000000-0000-0000-0000-000000000000
                                        UniqueUserId: 0
                                        Members: [0]
                                        MemberOf: [0]

    HasAuthenticated                : True

     

    PS C:\Users\JCorbei> Get-TfsServer -Name tfs -All
    Get-TfsServer : Could not load file or assembly 'Microsoft.TeamFoundation.VersionControl.Client, Version=10.0.0.0, Cult
    ure=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition do
    es not match the assembly reference.
    (Exception from HRESULT: 0x80131040)
    At line:1 char:14
    + Get-TfsServer <<<<  -Name tfs -all
        + CategoryInfo          : InvalidArgument: (:) [Get-TfsServer], FileLoadException
        + FullyQualifiedErrorId : GetTfsServer,Microsoft.TeamFoundation.PowerTools.PowerShell.GetTfsServerCommand

    PS C:\Users\JCorbei> $env:PROCESSOR_ARCHITECTURE
    x86
    PS C:\Users\JCorbei>


    • แก้ไขโดย Kenneth Brubaker 13 เมษายน 2554 14:56 Command line cut off.
    •  

ตอบทั้งหมด

  • 17 กุมภาพันธ์ 2554 20:24
     
     

    This may be appropriate info, but I don't know if this is the desired state:

    I can't find the assembly 'Microsoft.TeamFoundation.VersionControl.Client' in the C:\Windows\Microsoft.NET\assembly folders. Not in GAC_32, nor GAC_64, nor GAC_MSIL. Where should I be looking? It seems to indicate that a file is found.

     

    • แก้ไขโดย Kenneth Brubaker 18 กุมภาพันธ์ 2554 16:08 typos corrected
    •  
  • 18 กุมภาพันธ์ 2554 20:42
     
     

    More info:

    I found three versions on the machine:

    c:\Program Files (x86)>dir Microsoft.TeamFoundation.VersionControl.Client.dll /s
     /b
    c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ReferenceAssembl
    ies\v2.0\Microsoft.TeamFoundation.VersionControl.Client.dll
    c:\Program Files (x86)\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\M
    icrosoft.TeamFoundation.VersionControl.Client.dll
    c:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies
    \Microsoft.TeamFoundation.VersionControl.Client.dll

    c:\Program Files (x86)>

    I suppose I'm getting the wrong one, but I can't seem to get anything in the Fusion Log. Help!

  • 13 เมษายน 2554 18:35
     
      มีโค้ด

    I'm getting fusion log working but I'm still perplexed. I performed the copy of the PowerShell Snapin Registry information as suggested here. That didn't solve my problems, but the Fusion Log Viewer started working. Not sure why...

    If I run PowerShell (x86) I get this error in the Fusion Log:

     

    *** Assembly Binder Log Entry (4/13/2011 @ 1:48:54 PM) ***
    
    The operation failed.
    Bind result: hr = 0x80131040. No description available.
    
    Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
    Running under executable C:\Windows\syswow64\Windowspowershell\v1.0\powershell.exe
    --- A detailed error log follows. 
    
    === Pre-bind state information ===
    LOG: User = IAM\kbrubak
    LOG: DisplayName = Microsoft.TeamFoundation.VersionControl.Client, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=x86
     (Fully-specified)
    LOG: Appbase = file:///C:/Windows/syswow64/Windowspowershell/v1.0/
    LOG: Initial PrivatePath = NULL
    LOG: Dynamic Base = NULL
    LOG: Cache Base = NULL
    LOG: AppName = NULL
    Calling assembly : Microsoft.TeamFoundation.PowerTools.PowerShell, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.
    ===
    LOG: This bind starts in LoadFrom load context.
    WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().
    LOG: No application configuration file found.
    LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
    LOG: Post-policy reference: Microsoft.TeamFoundation.VersionControl.Client, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=x86
    ERR: An assembly with different processor architecture is already loaded.
    ERR: Unrecoverable error occurred during pre-download check (hr = 0x80131040).
    
    
    

     

    Note that the error is "An assembly with different processor architecture is already loaded".

    On 64 bit PowerShell I get:

     

    *** Assembly Binder Log Entry (4/13/2011 @ 1:43:18 PM) ***
    
    The operation failed.
    Bind result: hr = 0x80131047. No description available.
    
    Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework64\v2.0.50727\mscorwks.dll
    Running under executable C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe
    --- A detailed error log follows. 
    
    === Pre-bind state information ===
    LOG: User = IAM\kbrubak
    LOG: DisplayName = Microsoft.TeamFoundation.VersionControl.Client, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=x86
     (Fully-specified)
    LOG: Appbase = file:///C:/Windows/System32/WindowsPowerShell/v1.0/
    LOG: Initial PrivatePath = NULL
    LOG: Dynamic Base = NULL
    LOG: Cache Base = NULL
    LOG: AppName = NULL
    Calling assembly : Microsoft.TeamFoundation.PowerTools.PowerShell, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.
    ===
    ERR: Attempt to load an assembly with ProcessorArchitecture incompatible with the running process.
    
    
    

     

    Note that the error here is "Attempt to load an assembly with ProcessorArchitecture incompatible with the running process".

    So my conclusion is that in both Fusion is trying to load the assmbly but can't because of processor architecture incompatibilities. In 64 bti it seams to konw you are loading an x32 assembly and won't let you, in the 32bit instance it says an assembly is loaded that won't let the 32 bit one found to be loaded. The link to get things working on 64 bit machies seems to indicate htat yuou should be able to do this. bu it looks like you can't. For the 32 bit, lets look as a full log with successful loads and see. Unfortunately I don't see the assembly loaded. I do see other TFS client dlls loaded but none that specify the 32 bit architecture.

    When I use reflector to load Microsoft.TeamFoundation.VersionControl.Client as reference from Microsoft.TeamFoundation.PowerTools.PowerShell, the one reflector finds does NOT specify the 32 bit architecture.

    // Module Microsoft.TeamFoundation.VersionControl.Client.dll
    
     
    Version: 4487eaed-ee9d-449b-af1e-74a7a17c537a 
    Location: C:\Windows\assembly\GAC_MSIL\Microsoft.TeamFoundation.VersionControl.Client\10.0.0.0__b03f5f7f11d50a3a\Microsoft.TeamFoundation.VersionControl.Client.dll 
    Size: 694176 Bytes 
    Target Runtime: v2.0.50727 
    Platform Target: Any 
    

     

    It seems the problem is the requirement of the 32 bit architecture.

  • 8 มิถุนายน 2554 5:05
     
     

    I'm getting something simular resulting from  get-tfsserver $tfssrv -all

    Get-TfsServer : Could not load file or assembly 'Microsoft.TeamFoundation.VersionControl.Client, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its depende
    ncies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)

    Environment - Windows 7 64 bit, Visual Studio 2010, TFS Power Tools March 2011

    Although  [System.Reflection.Assembly]::LoadWithPartialName('Microsoft.TeamFoundation.VersionControl.Client')  yields:

    GAC    Version        Location                                                                                                                                                           
    ---    -------        --------                                                                                                                                                           
    True   v2.0.50727     C:\Windows\assembly\GAC_MSIL\Microsoft.TeamFoundation.VersionControl.Client\10.0.0.0__b03f5f7f11d50a3a\Microsoft.TeamFoundation.VersionControl.Client.dll          
    But then calling a VCS method DownloadFile() gets:

    Exception calling "DownloadFile" with "1" argument(s): "Team Foundation services are not available from server cstfs01.
    Technical information (for administrator):
      Cannot access a disposed object.
    Object name: 'Microsoft.TeamFoundation.Client.TfsTeamProjectCollection'."

    HELP.

  • 21 ตุลาคม 2554 22:25
     
     
    I am also having this exact problem.  I am on Windows 7 x64, VS 2010 Ultimate, Aug 2011 powertools.  Has anyone solved this problem?
    NickB
  • 16 มกราคม 2555 11:57
     
      มีโค้ด

    I've got the TFS 2010 PowerTools from December 2011 and get a similar error, both in x64 and x86 powershell consoles.

    *** Assembly Binder Log Entry  (16/01/2012 @ 11:42:03) ***
    
    The operation failed.
    Bind result: hr = 0x80131040. No description available.
    
    Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
    Running under executable  C:\Windows\syswow64\Windowspowershell\v1.0\powershell.exe
    --- A detailed error log follows. 
    
    === Pre-bind state information ===
    LOG: User = GPK\stephen_connolly
    LOG: DisplayName = Microsoft.TeamFoundation.VersionControl.Client, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=x86
     (Fully-specified)
    LOG: Appbase = file:///C:/Windows/syswow64/Windowspowershell/v1.0/
    LOG: Initial PrivatePath = NULL
    LOG: Dynamic Base = NULL
    LOG: Cache Base = NULL
    LOG: AppName = NULL
    Calling assembly : Microsoft.TeamFoundation.PowerTools.PowerShell, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.
    ===
    LOG: This bind starts in LoadFrom load context.
    WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().
    LOG: No application configuration file found.
    LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
    LOG: Post-policy reference: Microsoft.TeamFoundation.VersionControl.Client, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=x86
    ERR: An assembly with different processor architecture is already loaded.
    ERR: Unrecoverable error occurred during pre-download check (hr = 0x80131040).
    
    

    Can anyone shed any light? I'm on Windows 2008 R2 x64.

     

    Running checkasm against the main powershell snapin yields the following:

     ---------------------------
    Warning
    ---------------------------
    Circular dependency found: Microsoft.TeamFoundation.Client, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

     

    Microsoft.TeamFoundation.PowerTools.PowerShell, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

    Microsoft.TeamFoundation.PowerTools.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

    Microsoft.TeamFoundation.VersionControl.Client, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

    Microsoft.TeamFoundation.Client, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

    Microsoft.TeamFoundation, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

    Microsoft.TeamFoundation.Client, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

     

    Please note this warning is shown only once during analysis.
    ---------------------------
    OK  
    ---------------------------

    And when the warning is dismissed, a number of TFS assemblies show up in red:

    Microsoft.TeamFoundation.Client, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
    C:\Windows\assembly\GAC_MSIL\Microsoft.TeamFoundation.Client\10.0.0.0__b03f5f7f11d50a3a\Microsoft.TeamFoundation.Client.dll
    File could not be found.

    Microsoft.TeamFoundation, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
    C:\Windows\assembly\GAC_MSIL\Microsoft.TeamFoundation\10.0.0.0__b03f5f7f11d50a3a\Microsoft.TeamFoundation.dll
    File could not be found.

    But these two files are in the GAC AFAICT. The v10 ones show up as GAC_MSIL rather than GAC_32.

    If I build a C# client everything works fine, and Visual studio is doing OK as well. the only thing that could be an issue is that I've applied the forward compatibility pack to VS 2008 as our TFS server is 2010 but we're still using VS 2008 for day to day work. However I do have VS 2010 ultimate installed as it was the only way to get the updated PowerShell cmdlets.

    Any help gratefully received, as my machine is now shafted and I can't run any of my powershell scripts for day to day reporting and administration.

    Stephen