[英]How to load database project in VS2010 and VS2012?
I recently switched to VS2012 from VS2010, when opening a database project I get below error 我最近从VS2010切换到VS2012,当打开数据库项目时,我得到以下错误
C:\Trunk\Database\Database.dbproj : error : Internal Error. The database platform service with type Microsoft.Data.Schema.Sql.Sql100DatabaseSchemaProvider is not valid. You must make sure the service is loaded, or you must provide the full type name of a valid database platform service.
I'm guessing it might be the following line in the project file which it is choking on 我猜它可能是项目文件中的以下行,它正在窒息
<DSP>Microsoft.Data.Schema.Sql.Sql100DatabaseSchemaProvider</DSP>
or possibly this 或者可能这样
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\TeamData\Microsoft.Data.Schema.SqlTasks.targets" />
Any idea how to get past this error so I can load my project in VS2012? 知道如何通过这个错误,以便我可以在VS2012中加载我的项目吗?
Apparently Microsoft has a new Sql1110 DSP in VS2012. 显然,微软在VS2012中有一个新的Sql1110 DSP。 VS2010 has version Sql1100. VS2010的版本为Sql1100。
To fix this, inside your .dbproj file, change the following lines: 要解决此问题,请在.dbproj文件中更改以下行:
<ProjectVersion>4.0</ProjectVersion>
<ProjectGuid>{a233d7e8-b460-4b72-a345-aaeee4fb3aca}</ProjectGuid>
<DSP>Microsoft.Data.Schema.Sql.Sql100DatabaseSchemaProvider</DSP>
...
<!--Import the settings-->
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\TeamData\Microsoft.Data.Schema.SqlTasks.targets" />
<ItemGroup>
to this: 对此:
<ProjectVersion>4.1</ProjectVersion>
<ProjectGuid>{6cd7e290-f844-4410-97f6-e8fd6e63c5b5}</ProjectGuid>
<DSP>Microsoft.Data.Tools.Schema.Sql.Sql110DatabaseSchemaProvider</DSP>
...
<!--Import the settings-->
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets" />
<ItemGroup>
I created a new blank database project file in VS2012, compare the .sqlproj file to my old .dbproj, and the lines above are the main differences. 我在VS2012中创建了一个新的空白数据库项目文件,将.sqlproj文件与我的旧.dbproj进行比较,上面的行是主要区别。 Yes, microsoft changed the proj file extension, but you dont have to change your old dbproj extension. 是的,microsoft更改了proj文件扩展名,但您不必更改旧的dbproj扩展名。 It works on me. 它适用于我。
Since we don't have a full set of code to check on, it's hard to understand the exact problem, but for your import - you should change it to this: 由于我们没有完整的代码集来检查,因此很难理解确切的问题,但是对于导入 - 您应该将其更改为:
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Schema.SqlTasks.targets" />
If this doesn't solve the problem, please also update if you have Resharper installed by any chance, and try deleting its cache. 如果这不能解决问题,请在任何机会安装Resharper时更新,并尝试删除其缓存。
Just so other people may also encounter this same issue on VS2013, open your database project file .dbproj or .sqlproj in text editor: 其他人也可能在VS2013上遇到同样的问题,在文本编辑器中打开数据库项目文件.dbproj或.sqlproj:
Change: 更改:
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\TeamData\Microsoft.Data.Schema.SqlTasks.targets" />
To: 至:
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets" />
And from 来自
<ProjectVersion>4.0</ProjectVersion>
To: 至:
<ProjectVersion>4.1</ProjectVersion>
And from 来自
<DSP>Microsoft.Data.Schema.Sql.Sql100DatabaseSchemaProvider</DSP>
To: 至:
<DSP>Microsoft.Data.Tools.Schema.Sql.Sql120DatabaseSchemaProvider</DSP>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.