Partial binding information was supplied for an assembly mstest

21,962

Solution 1

I ran into this as well, and it had nothing to do with MS Test or any unit testing framework, I was actually running into this in a web project, where code would compile fine but break when web.config referenced SimpleMembershipProvider. I had used the updated NuGet package Microsoft.AspNet.WebPages.WebData, which put WebMatrix.WebData in as a reference, but it failed to set CopyLocal=true.

The solution seems to be to simply set CopyLocal=true in the WebMatrix.WebData (and WebMatrix.Data) properties under the project's References.

I believe CopyLocal=false has to be explicitly set in a NuGet install script, in which case this seems to be a major design stupidity flaw, not a bug.

Solution 2

This seems to be a bug in the framework. However, was fixed by placing

WebMatrix.WebData.dll

inside the MsTest directory (C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE) on the build server

Share:
21,962
Admin
Author by

Admin

Updated on October 12, 2020

Comments

  • Admin
    Admin over 3 years

    I am using the new SimpleMembership framework in .Net.

    The unit tests to create users (using the API - see below) work fine locally in Visual Studio 2012 IDE.

    WebSecurity.CreateUserAndAccount(entity.UserName, entity.Password, new { });

    However, when running on the build server (using TeamCity) I get the following below.

    I have tried Dependency Walker with no luck. I also can't think how this could be run in x64 - considering VS2012 runs in x86.

    Any help would be appreciated.

    threw exception:

    System.IO.FileNotFoundException: Could not load file or assembly 'WebMatrix.WebData' or one of its dependencies. The system cannot find the file specified.=== Pre-bind state information ===
    LOG: User =  
    LOG: DisplayName = WebMatrix.WebData
    (Partial)
    WRN: Partial binding information was supplied for an assembly:
    WRN: Assembly Name: WebMatrix.WebData | Domain ID: 2
    WRN: A partial bind occurs when only part of the assembly display name is provided.
    WRN: This might result in the binder loading an incorrect assembly.
    WRN: It is recommended to provide a fully specified textual identity for the assembly,
    WRN: that consists of the simple name, version, culture, and public key token.
    WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
    LOG: Appbase = file:///C:/Program Files (x86)/Microsoft Visual Studio 
    LOG: Initial PrivatePath = NULL
    Calling assembly : (Unknown).*
    
  • draconis
    draconis over 11 years
    This worked for me. Thanks a lot, wouldn't have figured it out on my own.
  • Diganta Kumar
    Diganta Kumar about 11 years
    When I installed the NuGet package and the CopyLocal=true by default. I guess it's been updated. I am using a mstest project with EF5 code first to recreate the database if model change. My issue was resolved by add the WebMatrix.WebData.dll to this directory "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE". Thank you to all.