15

After installing the VSTS Database GDR and importing a SQL Server 2005 database that includes the ASP.NET provider schema tables, I get the following warnings:

TSD04151: Procedure: [dbo].[aspnet_Users_DeleteUser] has an unresolved reference to object [dbo].[sysobjects].[name].

TSD04151: Procedure: [dbo].[aspnet_Users_DeleteUser] has an unresolved reference to object [dbo].[sysobjects].

TSD04151: Procedure: [dbo].[aspnet_AnyDataInTables] has an unresolved reference to object [dbo].[sysobjects].[type].

TSD04151: Procedure: [dbo].[aspnet_Users_DeleteUser] has an unresolved reference to object [dbo].[sysobjects].[type].

TSD04151: Procedure: [dbo].[aspnet_AnyDataInTables] has an unresolved reference to object [dbo].[sysobjects].

TSD04151: Procedure: [dbo].[aspnet_AnyDataInTables] has an unresolved reference to object [dbo].[sysobjects].[name].

Does anyone know how to get rid of these warnings?

Daniel Mann
  • 57,011
  • 13
  • 100
  • 120
Chad Green
  • 477
  • 4
  • 16

2 Answers2

18

I'm not sure, but a quick look seems to reveal the following. The offending line in the script seems to be:

Line 42 in procedure [dbo].[aspnet_Users_DeleteUser] (how do you do underscores here?) (like this: \_ )

(EXISTS (SELECT name FROM sysobjects WHERE (name = N'vw_aspnet_MembershipUsers') AND (type = 'V'))))

the system view sysobjects belongs to the built in system schema 'sys' which is not included in the database project. As a result the database project parser thinks (wrongly) that the reference is unresolved.

I don't think there is anything you can do but select to ignore the warning from the project settings. (Be aware that that will hide real errors from you as well.) I would probably just ignore the warnings.

Update: Try to add a reference to:

C:\Program Files\Microsoft Visual Studio 9.0\VSTSDB\Extensions\SqlServer\2008\DBSchemas\master.dbschema

Euro Micelli
  • 33,285
  • 8
  • 51
  • 70
Kim Major
  • 3,681
  • 1
  • 22
  • 20
  • 1
    Adding the reference did the trick. One thing to note, since I'm targeting a SQL 2005 database, I referenced the following: C:\Program Files\Microsoft Visual Studio 9.0\VSTSDB\Extensions\SqlServer\2005\DBSchemas\master.dbschema – Chad Green Dec 22 '08 at 21:22
  • Thanks! It also works for VS2010 and SQL2008. The right folder there is (for x64 systems): C:\Program Files (x86)\Microsoft Visual Studio 10.0\VSTSDB\Extensions\SqlServer\2008 – Wiebe Tijsma Jun 09 '10 at 13:49
  • What kind of reference should I add for this file? The only one that I could add is to an XSD file, without effect (no reference was added to database project). Thanks! – bloparod Apr 06 '11 at 02:51
  • Ignore my question, it was a Database reference =D. – bloparod Apr 06 '11 at 15:19
3

Kim's answer above works perfectly for the situation I asked for. But, I also found out that you can filter the build warnings per file. Look at http://blogs.msdn.com/gertd/archive/2009/01/11/file-level-build-warning-suppression-in-the-gdr.aspx

Chad Green
  • 477
  • 4
  • 16