【问题标题】:Visual Studio Online cannot build project due to Entity Framework reference cannot be resolved由于无法解决实体框架引用,Visual Studio Online 无法构建项目
【发布时间】:2015-06-02 05:30:15
【问题描述】:

我可以做些什么来修复这个构建?通过 NuGet 将实体框架添加到此项目。

所有项目在本地系统上编译都没有问题。但是在 Visual Studio Online 上构建失败。

通过打开诊断日志记录,我可以追踪到这个导致我的构建失败的警告:

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "EntityFramework.SqlServer". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

【问题讨论】:

  • 始终将 EntityFramework.SqlServer.dll 标记为副本

标签: entity-framework msbuild nuget tfsbuild azure-devops


【解决方案1】:

请勿右键单击该项目并选择“启用 NuGet 包还原”。这是按照Nuget Docs 进行包恢复的“旧方式”。

默认情况下,包恢复应作为构建过程的一部分进行。如果不是(似乎是这种情况),那么您遇到了不同的问题,但没有足够的信息来说明什么。

【讨论】:

  • 感谢您的提醒。但是,Visual Studio 2013 已经按照您帖子中链接的建议创建了 .nuget 文件夹。这意味着它不再是一种过时的方式。此外,它确实解决了我在 VisualStudio.com 构建服务器上的错误。
【解决方案2】:

我可以通过在解决方案资源管理器中右键单击解决方案并选择启用 NuGet 包还原来解决此错误。

这会在我的解决方案中添加更多文件并修改一些项目文件。然后构建服务器可以在构建时恢复包并最终满意。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-12-31
    • 2021-12-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-04-22
    • 2015-10-20
    • 2014-07-27
    相关资源
    最近更新 更多