Monday, May 19, 2014

.NET and Reference Versions

Ran into this error today when migrating our company addins to 2015:

The type or namespace name 'Autodesk' could not be found (are you missing a using directive or an assembly reference?

The first thing I tried was to remove the "RevitAPI.dll" and "RevitAPIUL.dll" references and re-add them (I had already confirmed they were being loaded from the 2015 install location). This step failed to correct my issue. Turns out it was a simple oversight on my part; Revit 2015 requires .NET 4.5 and the reference dlls are compiled in that version... my upgraded project had its "Target Framework" set to version 4, simply changing this to 4.5 corrected the problem.

No comments:

Post a Comment