0
  • Visual Studio 2010 终极版
  • 微软 SQL 服务器 2008
  • 默认 .NET SqlMembershipProvider(aspnet_Users、aspnet_Memmbership 等...)

我建立了一个数据库项目,以保持数据库在环境之间同步并保持版本化。该数据库有一些我创建的简单表,然后是运行该aspnet_regsql.exe工具时获得的 SqlMembership 提供程序的默认安装。我执行了从数据库到数据库项目的模式比较,VS 生成了所有脚本。伟大的。

但是,我收到了一堆错误,这些错误会破坏有关该aspnet_regsql工具创建的某些对象的构建。

Schema: [aspnet_WebEvent_FullAccess] has an unresolved reference to object [aspnet_WebEvent_FullAccess].
Schema: [aspnet_Membership_BasicAccess] has an unresolved reference to object [aspnet_Membership_BasicAccess].
Schema: [aspnet_Membership_FullAccess] has an unresolved reference to object [aspnet_Membership_FullAccess].
Schema: [aspnet_Membership_ReportingAccess] has an unresolved reference to object [aspnet_Membership_ReportingAccess].
Schema: [aspnet_Personalization_BasicAccess] has an unresolved reference to object [aspnet_Personalization_BasicAccess].
Schema: [aspnet_Personalization_FullAccess] has an unresolved reference to object [aspnet_Personalization_FullAccess].
Schema: [aspnet_Personalization_ReportingAccess] has an unresolved reference to object [aspnet_Personalization_ReportingAccess].
Schema: [aspnet_Profile_BasicAccess] has an unresolved reference to object [aspnet_Profile_BasicAccess].
Schema: [aspnet_Profile_FullAccess] has an unresolved reference to object [aspnet_Profile_FullAccess].
Schema: [aspnet_Profile_ReportingAccess] has an unresolved reference to object [aspnet_Profile_ReportingAccess].
Schema: [aspnet_Roles_BasicAccess] has an unresolved reference to object [aspnet_Roles_BasicAccess].
Schema: [aspnet_Roles_FullAccess] has an unresolved reference to object [aspnet_Roles_FullAccess].
Schema: [aspnet_Roles_ReportingAccess] has an unresolved reference to object [aspnet_Roles_ReportingAccess].

在我看来,它们都非常循环。如何摆脱这些错误?如果我不能摆脱它们,我可以将它们从我的模式比较中排除吗?如何?

提前致谢!

4

1 回答 1

1

我猜左边的项目是模式,右边的项目是匹配名称的匹配数据库角色,所以虽然它看起来是圆形的,但它们实际上是不同的对象。

如果您查看数据库-> 安全性-> 角色,然后查看模式,您会看到这两个集合吗?

您是否同时拥有数据库角色和数据库项目中的模式?可能是您将模式与数据库同步但没有与角色同步?你要么都不需要,要么两者都需要。

如果您不想将权限更改部署到数据库IgnorePermissions,则设置中有一个选项。.sqldeployment如果您没有在您的数据库项目中同步权限,但想要删除目标数据库中不在模型中的所有其他内容,这可能会很有用(GenerateDropsIfNotInProjectin .sqldeployment

希望这可以帮助

于 2011-06-08T10:32:39.380 回答