By Aaron Lu
Sometimes we've got this kind of compile error when migrating our project from Revit 2014 to Revit 2015:
The type or namespace name 'Autodesk' could not be found (are you missing a using directive or an assembly reference?)
Even if the reference of RevitAPI.dll and RevitAPIUI.dll is correct. We can't figure out what is the problem.
Here is the answer:
Revit is compiled with .NET 4.5, and if our VS project is built against .NET 4.0 or any version prior to .NET 4.5, VS can't recognize the RevitAPI.dll and RevitAPIUI.dll, that's why we got that comiple error.
to solve it, just set the "Target framework" to .NET 4.5 from property page of our VS project, like below: