1

我已在本地计算机上将 EntityFramework 从 4.1 升级到 5,并将 .NET Framework 升级到 4.5,一切正常,但是当我在 Azure 上发布我的更改时,我收到此错误:

Server Error in '/' Application.

Could not load file or assembly 'Microsoft.Build.Utilities.v3.5, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Build.Utilities.v3.5, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.Build.Utilities.v3.5, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' could not be loaded.


WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
4

2 回答 2

2

检查该程序集的项目引用。确保您已将该引用的属性上的 copy local 设置为 true。此外,升级 Azure SDK 和 EF 可能会影响项目引用的程序集版本。确保您的项目中也引用了正确的版本。

发现什么可能是您的问题的根源 -> 特别是如果您正在升级您的项目:http: //ivarunsingh.blogspot.com/2011/12/microsoftbuildutilitiesv35-report.html

于 2012-11-02T18:36:18.553 回答
0

您是否正在部署到 Windows Server 2012 映像(我看到您使用的是 .NET 4.5)?如果您使用 Azure SDK 1.8 并且 OSVersion = 3(新 SDK 上的新云服务项目的默认设置)...

Windows Server 2012 没有启用 .NET 3.5 库,您必须启用该功能(我相信安装它)。您可能必须自动启用 .NET 3.5。

于 2012-11-03T18:46:29.503 回答