升级到 Visual Studio 2013 后,由于缺少 SqlServer.targets 文件,项目无法加载

Project fails to load due to missing SqlServer.targets file after upgrading to Visual Studio 2013(升级到 Visual Studio 2013 后,由于缺少 SqlServer.targets 文件,项目无法加载)
本文介绍了升级到 Visual Studio 2013 后,由于缺少 SqlServer.targets 文件,项目无法加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

升级到 Visual Studio 2013 后,我发现在尝试打开解决方案时无法加载旧的 SQL 项目.显示的错误是:

Having upgraded to Visual Studio 2013, I have found that an old SQL project fails to load when I attempt to open a solution. The error displayed is:

未找到导入的项目C:Program Files (x86)MSBuild12.0inSqlServer.targets".确认声明中的路径正确,并且该文件存在于磁盘上.C:SomePathToProjectDatabase.sqlproj

The imported project "C:Program Files (x86)MSBuild12.0inSqlServer.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk. C:SomePathToProjectDatabase.sqlproj

在我的 .sqlproj 文件中,我有一行

In my .sqlproj file I have the line

<Import Project="$(MSBuildToolsPath)SqlServer.targets" />

在 Visual Studio 2012 中解析为 C:WindowsMicrosoft.NETFrameworkv4.0.30319SqlServer.targets 但在 Visual Studio 2013 中解析为 C:Program文件 (x86)MSBuild12.0inSqlServer.targets.但是,SqlServer.targets 文件不在这些位置.

which in Visual Studio 2012 resolves to C:WindowsMicrosoft.NETFrameworkv4.0.30319SqlServer.targets but in Visual Studio 2013 this resolves to C:Program Files (x86)MSBuild12.0inSqlServer.targets. However, the SqlServer.targets file is in neither of these locations.

这可能是因为 MSBuild 成为 Visual Studio 的一部分,而不是它成为 .Net Framework 的一部分.

Presumably this is due to MSBuild becoming part of Visual Studio, rather than it being part of the .Net Framework.

有谁知道如何解决这个问题并将这个项目迁移到 Visual Studio 2013?

Does anyone know how to fix this issue and to migrate this project to Visual Studio 2013?

推荐答案

我在VS 2013下尝试构建VS 2010解决方案时遇到了同样的问题.解决方法是先将解决方案文件升级到VS 2013.之后,它无需进一步修改即可工作.

I had the same problem when trying to build a VS 2010 solution under VS 2013. The fix was to upgrade the solution file to VS 2013 first. After that it worked without further modifications.

这篇关于升级到 Visual Studio 2013 后,由于缺少 SqlServer.targets 文件,项目无法加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Execute complex raw SQL query in EF6(在EF6中执行复杂的原始SQL查询)
SSIS: Model design issue causing duplications - can two fact tables be connected?(SSIS:模型设计问题导致重复-两个事实表可以连接吗?)
SQL Server Graph Database - shortest path using multiple edge types(SQL Server图形数据库-使用多种边类型的最短路径)
Invalid column name when using EF Core filtered includes(使用EF核心过滤包括时无效的列名)
How should make faster SQL Server filtering procedure with many parameters(如何让多参数的SQL Server过滤程序更快)
How can I generate an entity–relationship (ER) diagram of a database using Microsoft SQL Server Management Studio?(如何使用Microsoft SQL Server Management Studio生成数据库的实体关系(ER)图?)