5

SimpleMembership.Netで新しいフレームワークを使用しています。

ユーザーを作成するための単体テスト (API を使用 - 以下を参照) は、Visual Studio 2012 IDE でローカルに正常に動作します。

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

ただし、ビルド サーバーで (TeamCity を使用して) 実行すると、次のようになります。

依存関係ウォーカーを試してみましたが、うまくいきませんでした。また、VS2012がx86で実行されていることを考えると、これをx64で実行する方法も考えられません。

どんな助けでも大歓迎です。

例外をスローしました:

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).*
4

3 に答える 3

17

私もこれに遭遇しました.MS Testまたはユニットテストフレームワークとは何の関係もありません.Webプロジェクトで実際にこれに遭遇しました.コードは正常にコンパイルされますが、web.configがSimpleMembershipProviderを参照すると壊れます. 更新された NuGet パッケージ Microsoft.AspNet.WebPages.WebData を使用して、WebMatrix.WebData を参照として入れましたが、CopyLocal=true を設定できませんでした。

解決策は、プロジェクトの参照の下にある WebMatrix.WebData (および WebMatrix.Data) プロパティで CopyLocal=true を設定するだけのようです。

私は、NuGet インストール スクリプトで CopyLocal=false を明示的に設定する必要があると考えています。

于 2012-11-27T17:23:07.260 に答える
1

これはフレームワークのバグのようです。ただし、配置することで修正されました

WebMatrix.WebData.dll

ビルドサーバーのMsTestディレクトリ(C:\ Program Files(x86)\ Microsoft Visual Studio 11.0 \ Common7 \ IDE)内

于 2012-11-08T11:21:54.173 に答える
0

Web 構成のバインディング リダイレクト構成を変更して、このエラーを修正しました。ナゲットパッケージをアップグレードするときに間違って設定していました。

修正するために、次から変更しました:

<dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-6.0.4.17603" newVersion="6.0.4.17603" />
      </dependentAssembly>

これに:

<dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
      </dependentAssembly>
于 2014-10-27T11:49:19.443 に答える