Jon Gallant

[object Object]

1 min read

There are many reasons why this error will appear. One of the less obvious reasons has to do with the “Target framework” project level setting.

In my referenced project the “Target framework” was set to “.NET Framework 4”

Screenshot

And in the referencing project the “Target framework” was set to “.NET Framework 4 Client Profile”

Screenshot

And I got the build error:

Screenshot

Error 2 The type or namespace name ‘TFSCommon’ could not be found (are you missing a using directive or an assembly reference?) C:_work\Dev\TFSCode\QueryTextViewer\Program.cs 8 11 QueryTextViewer

These target frameworks need to match. So just set your referencing project to the same “Target framework” and the build error will be resolved.

Jon

Share:
Share on X