VS Database Project Error TSD04105, Build Issues With Multiple Projects

Problem: You have multiple database projects in a solution, one references another, and when you go to build you get some or a lots of TSD04105 or TSD03006 errors because you have the same named item it both of your projects.  For example, Project_1.myschema.SomeDbObject and Project_2.myschema.SomeDbObject and Project_2 has a db reference to Project_1.

Solution:  I googled this for while and it appears there are/were some bugs around this issue.  Supposedly they were fixed in the GDR release but not that I can tell, see this bug article.  What you need to do is uniquely identify the objects that have the same name which reside in both of the projects.  You can give a name to you data project that is reference either when you are adding the reference or afterwards by going to the References tab in the project properties.

When adding a project reference, you define database variable which can either be a literal value or a variable name such as $(MyVariable).

add_reference

If you do it after adding the database reference, you can accomplish the above task by going to the References tab in the properties of the project.  Below shows what that screen will look like from VS2008.  To setup a database variable, enter in a name in the column “Database Variable Name” or “Database Variable Value” column.  If you check the Literal checkbox, you can only enter in the “Database Variable Value” column.

references_tab

Now the project should build since the same named objects will be uniquely identified by “Database Variable Value”.myschema.SomeDbObject.

No comments: