VS2010 - SQL CRL 部署错误 - 部署错误 SQL04105:模型已具有同名的元素
我在 VS2010 中创建了一个 SQL CLR 项目。它需要运行 PreDeployScript.sql 和 PostDeployScript.sql。这两个文件都存在于项目中。但是,当尝试运行部署时,我收到以下错误消息:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\TeamData\Microsoft.Data.Schema.SqlClr.targets(96,5):部署错误 SQL04105:模型已有一个元素具有相同的名称 dbo.PropertySetCollection。
对于我们拥有的每种类型,都会重复此消息。这让我相信 PreDeployScript.sql 没有运行。 还有其他人遇到过这个问题吗?有解决方法吗?
I have a SQL CLR project created in VS2010. It needs to run PreDeployScript.sql and PostDeployScript.sql. Both files exist in project. However, when trying to run the deploy, I get the following error messages:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\TeamData\Microsoft.Data.Schema.SqlClr.targets(96,5): Deploy error SQL04105: The model already has an element that has the same name dbo.PropertySetCollection.
This message is repeated for every single type we have. This leads me to believe that PreDeployScript.sql was not run.
Has anybody else run into this issue? Is there a workaround?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
确保您没有更改解决方案名称。如果有的话,您现在将与 SQL Server 上的程序集名称不同步。要解决此问题,只需删除现有程序集的所有存储过程,删除程序集,然后再次尝试部署。将在 SQL Server 上创建一个新程序集,其解决方案名称为 VS 中的名称。
Make sure you have not changed the Solution name. If you have you will now be out of sync with the assembly name on the SQL Server. To fix this just drop all the stored procedures for the existing assembly, drop the assembly, then try the deploy again. A new assembly will be created on SQL Server with the Solution name that is in VS.
尝试使用 Sql Proviler 检查 PreDeploy.sql 是否已运行。
另请阅读:
https://connect.microsoft.com/VisualStudio/feedback/details/539211/db-projects-with-same-object-names-cannot-be -used-as-database-reference-error-sql04105?wa=wsignin1.0
Try using the Sql Proviler to check if the PreDeploy.sql has run.
Also read this:
https://connect.microsoft.com/VisualStudio/feedback/details/539211/db-projects-with-same-object-names-cannot-be-used-as-database-reference-error-sql04105?wa=wsignin1.0
这是VS2010 SQL CLR部署中的一个错误。它与在部署前/部署后脚本中删除/添加计算列有关。 MS 正在研究解决方案。
It is a bug in VS2010 SQL CLR deployment. It has do to with dropping / adding computed columns in pre/post deploy scripts. MS is working on a solution.