新しいMVC3WebアプリをAzureにデプロイすると、エラーが発生します。サイトは機能しているように見えますが、役割の初期化エラーがあり、VS2010からの展開が完了しないことを意味します。(以下の出力を参照してください。)
Mindscape.Lightspeed.WebアセンブリはMVC2に依存していると思いますが、次の設定セクションで上書きされると思いました。
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
開発システムからMVC2をアンインストールしてから開発ファブリックで実行することにより、Azureプロジェクトでこれをシミュレートできます。
どうすればこれを修正できますか?
Microsoft.WindowsAzure.ServiceRuntime Critical: 201 : 'iisexpress.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\1001b7f1\d3c78bbf\assembly\dl3\d2532ce7\a08fd830_9d4bcd01\Microsoft.WindowsAzure.Configuration.DLL'
Role entrypoint could not be created:
System.TypeLoadException: Unable to load the role entry point due to the following exceptions:
-- System.IO.FileLoadException: Could not load file or assembly 'System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
=== Pre-bind state information ===
LOG: User = DiscoveryOne\scott
LOG: DisplayName = System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
(Fully-specified)
LOG: Appbase = file:///C:/Users/scott/Documents/Visual Studio 2010/Projects/Teto.Azure/Teto.Azure/csx/Debug/roles/Teto.Web/approot/bin
LOG: Initial PrivatePath = C:\Users\scott\Documents\Visual Studio 2010\Projects\Teto.Azure\Teto.Azure\csx\Debug\roles\Teto.Web\approot\bin
Calling assembly : Mindscape.LightSpeed.Web, Version=4.0.1351.20441, Culture=neutral, PublicKeyToken=360c8f37b466ebb2.
===
LOG: This bind starts in default load context.
LOG: No application configuration file found.
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Post-policy reference: System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
LOG: Attempting download of new URL file:///C:/Users/scott/Documents/Visual Studio 2010/Projects/Teto.Azure/Teto.Azure/csx/Debug/roles/Teto.Web/approot/bin/System.Web.Mvc.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Major Version
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
---> System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.Assembly.GetTypes()
at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.GetRoleEntryPoint(Assembly entryPointAssembly)
--- End of inner exception stack trace ---
at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.GetRoleEntryPoint(Assembly entryPointAssembly)
at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.CreateRoleEntryPoint(RoleType roleTypeEnum)
at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.InitializeRoleInternal(RoleType roleTypeEnum)
The program '[1564] WaIISHost.exe: Program Trace' has exited with code 0 (0x0).
The program '[1564] WaIISHost.exe: Managed (v4.0.30319)' has exited with code -1 (0xffffffff).