Are you missing a using directive or an assembly reference?

By | June 20, 2016

Ever saw this error “Are you missing a using directive or an assembly reference”.
Even after adding the assembly?
Even when Visual studio Intellisense is not complaining.
But still compilation fails.

Are you missing a using directive or an assembly reference

Ever heard of Output window? Visual Studio shortcut : Ctrl+W,O
cartman-respect-my-authority

Not keeping it open while compiling?
Are you missing a using directive or an assembly reference again

I did make this mistake. Guess what the Output window was trying to tell me all the time?

I will not post the whole output log. But here is what it was screaming at me.

1>C:\Program Files\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1697,5): warning MSB3274: The primary reference “StarkIndustries.Driver.IMissileSeeker” could not be resolved because it was built against the “.NETFramework,Version=v4.5.1” framework. This is a higher version than the currently targeted framework “.NETFramework,Version=v4.5”.

Yup. The referenced library was targeting .Net 4.5.1 while the project I was including it in was targeting .Net 4.5.

Lesson
Output window can be a live/timesaver. RESPECT ITS AUTHORITAH!!!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.