2012-04-30 19 views
1

私のASP.NET MVC 4アプリケーションは、IISとIEExpress環境で完全に動作しています。 残念ながら、さまざまなバージョンのEntityFrameworkに問題があるようです。 EF 4.1.0.0の発生について、すべての参照がdoubleとtrippleでチェックされています。現在、EF 4.3.0.0は全員に未着です。 システムのどこかに、4.1.0.0への参照と見つけようとしているようです。成功なし。AzureがEntityFrameworkへの参照を見つけることができません

関連するすべての外部LIBSが「真=ローカルコピー」

Microsoft.WindowsAzure.ServiceRuntime Critical: 201 : Role entrypoint could not be created: 
System.TypeLoadException: Unable to load the role entry point due to the following exceptions: 
-- System.IO.FileLoadException: Die Datei oder Assembly "EntityFramework, Version=4.1.0.0,  Culture=neutral, PublicKeyToken=b77a5c561934e089" oder eine Abhängigkeit davon wurde nicht gefunden.  Die gefundene Manifestdefinition der Assembly stimmt nicht mit dem Assemblyverweis überein. (Ausnahme von HRESULT: 0x80131040) 
Dateiname: "EntityFramework, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" 

=== Zustandsinformationen vor Bindung === 
LOG: Benutzer = COREI7\markus 
LOG: DisplayName = EntityFramework, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 
(Fully-specified) 
LOG: Appbase = file:///D:/Dev/TFS/BettrFit/BettrFit.Azure/csx/Debug/roles/BettrFit/approot/bin 
LOG: Ursprünglicher PrivatePath = D:\Dev\TFS\BettrFit\BettrFit.Azure\csx\Debug\roles\BettrFit\approot\bin 
Aufruf von Assembly : System.Web.Http.Data.EntityFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35. 
=== 
LOG: Diese Bindung startet im default-Load-Kontext. 
LOG: Es wurde keine Anwendungskonfigurationsdatei gefunden. 
LOG: Die Hostkonfigurationsdatei wird verwendet: 
LOG: Die Computerkonfigurationsdatei von C:\Windows\Microsoft.NET\Framework64\v4.0.30319 \config\machine.config wird verwendet. 
LOG: Verweis nach der Richtlinie: EntityFramework, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 
LOG: Download von neuem URL file:///D:/Dev/TFS/BettrFit/BettrFit.Azure/csx/Debug/roles/BettrFit/approot/bin/EntityFramework.DLL. 
WRN: Der Vergleich des Assemblynamens führte zum Konflikt: Nebenversion. 
ERR: Das Setup der Assembly konnte nicht abgeschlossen werden (hr = 0x80131040). Die Suche wurde beendet. 

---> System.Reflection.ReflectionTypeLoadException: Mindestens ein Typ in der Assembly kann nicht geladen werden. Rufen Sie die LoaderExceptions-Eigenschaft ab, wenn Sie weitere Informationen benötigen. 
    bei System.Reflection.RuntimeModule.GetTypes(RuntimeModule module) 
    bei System.Reflection.RuntimeModule.GetTypes() 
    bei System.Reflection.Assembly.GetTypes() 
    bei Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.GetRoleEntryPoint(Assembly entryPointAssembly) 
    --- Ende der internen Ausnahmestapelüberwachung --- 
    bei Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.GetRoleEntryPoint(Assembly entryPointAssembly) 
    bei Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.CreateRoleEntryPoint(RoleType roleTypeEnum) 
    bei Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.InitializeRoleInternal(RoleType roleTypeEnum) 
Das Programm "[2372] WaIISHost.exe: Verwaltet (v4.0.30319)" wurde mit Code -1 (0xffffffff) beendet. 

としてマークされているが、あなたたちはこの問題を解決する方法についていくつかのヒントを与えることを願っています。

私はData.EntityFrameworkアセンブリを調査:

Assembly a = System.Reflection.Assembly.Load("System.Web.Http.Data.EntityFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"); 

foreach (AssemblyName i in a.GetReferencedAssemblies()) 
{ 
    Trace.TraceInformation("Ref Assemblies:" + i.Name+" "+i.Version); 
} 

それはそのデフォルトとしてEntityFramework 4.1.0.0に依存することを示しています。 どうすれば変更できますか? Web.Configは読み込み時に使用されていないようです - ここではすでに再バインドを試みました。

+0

(グローバルアセンブリキャッシュに)ローカルにインストールされ、Azureに存在しない間接参照もチェックしましたか? http://stackoverflow.com/a/10142356/468244 +のコメントをご覧ください。 –

+0

私はGACViewerでチェックしました - これまで運がありません。私は、System.Web.Http.Entityframeworkが問題の原因かもしれないと思う。 しかし、私はlibが参照しているバージョンを確認する手がかりがありません。 ログには、Calling Assemblyという名前が付けられています。パッケージと一緒にデプロイされたときに「新しい」バージョンを使用するように設定するにはどうすればよいですか? – Obiwan007

答えて

0

4.3.0.0に4.1.0.0をリダイレクトするために、アセンブリのリダイレクトを使用してみてください:

<runtime> 
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> 
    <dependentAssembly> 
     <assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" /> 
     <bindingRedirect oldVersion="4.0.0.0 - 4.2.0.0" newVersion="4.3.0.0"/> 
    </dependentAssembly> 
    </assemblyBinding> 
</runtime> 

よろしく、

明徐。

+0

申し訳ありません。私のweb.configには、このようなリダイレクトが含まれています。あなたも試しました - 運はありません。 システムがweb.configランタイムセクションを無視しているようです。 – Obiwan007

2

Web-Role Projectでapp.configファイルを提供することで修正しました。 Azureスタートアップコードは、通常使用されるWeb.Configの代わりにApp.Configファイルを使用しているようです。

私のapp.configは、ランタイム/ assemplyreferencesリダイレクトバインディングコードを追加します。

関連する問題