简体   繁体   English

如何在VS2010和VS2012中加载数据库项目?

[英]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.

相关问题 将项目从VS2010迁移到VS2012后无法继承接口 - can't inherit interface after migrating project from VS2010 to VS2012 VS2010和VS2012的两个C#项目文件在同一目录中 - Two C# project files for VS2010 and VS2012 in the same directory 在项目开发过程中从VS2010升级到VS2012会有任何风险吗? - Is there any risk in upgrading from VS2010 to VS2012 in the middle of project development? DeploymentItem在VS2010和VS2012中的行为方式不同 - DeploymentItem behaving differently in VS2010 and VS2012 VS2010 C ++ / CLI项目总是认为VS2012 C#项目已经过时了 - VS2010 C++/CLI project always thinks VS2012 C# project is out of date AppFabric DataCacheFactory()初始化在VS2013中挂起,在VS2010和VS2012中正常工作 - AppFabric DataCacheFactory() initialization hangs in VS2013, works fine in VS2010 and VS2012 VS2012 OutOfMemoryException与VS2010没有异常的工作 - VS2012 OutOfMemoryException vs. VS2010 working w/o Exception Moq和Interop类型:在VS2012中工作,在VS2010中失败? - Moq & Interop Types: works in VS2012, fails in VS2010? 无法在vs2012中打开vs2010 csproj文件 - can't open vs2010 csproj file in vs2012 从VS2010移至VS2012后,HTML渲染间歇性丢失内容 - After move from VS2010 to VS2012 HTML rendering is intermittently losing content
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM