Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Unresolved Reference To Built In Type" errors on basic SQL data types

My database projects in Visual Studio have recently starting throwing these unresolved reference errors every time any create table file in the project is touched.

SQL71501: Column: ___ has an unresolved reference to Built-in Type [int].
SQL71501: Column: ___ has an unresolved reference to Built-in Type [datetime].
SQL71501: Column: ___ has an unresolved reference to Built-in Type [varchar].

If I rebuild the project, everything builds with no errors, and the errors flagged by Visual Studio disappear. However, as soon as I edit any file (even as little as adding a space to the end of a file), that file will immediately become plagued with these unresolved reference errors... until I rebuild again. However, as it's a fairly large project, I don't want to spend about a minute rebuilding after every single minor edit.

This project is worked on by several other people, who do not encounter this issue. How can I resolve this?


Update: If I change tabs, the errors for the first tab disappear until I go back to it. I've also disabled all extensions, but the problem still occurs.

like image 936
Kai Avatar asked Jan 14 '16 10:01

Kai


2 Answers

Close down Visual Studio, navigate to the project folder and find the .dbmdl file. Delete it. Reopen the project and rebuild it. This should solve the problem.

like image 114
Kai Avatar answered Oct 14 '22 19:10

Kai


In my case the solution was to change the target of my SSDT project to a more recent version of SQL Server (right click on the projet/Properties/Project Settings/Target platform).

See: https://www.codeproject.com/Articles/565459/FixingplusSSDTplusunresolvedplusreferenceplustoplu

like image 39
Fl4v Avatar answered Oct 14 '22 17:10

Fl4v