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).*
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With