Visual Studio 2019 -> RevitDB.dll The reference is invalid or unsupported

Visual Studio 2019 -> RevitDB.dll The reference is invalid or unsupported

aclarke
Advocate Advocate
5,176 Views
3 Replies
Message 1 of 4

Visual Studio 2019 -> RevitDB.dll The reference is invalid or unsupported

aclarke
Advocate
Advocate

Anybody getting this error messeage when trying to reference RevitDB.dll in VS2019.  I've tried on 3 different machines all with the same result.

 

RevutUI,  RevitAPI  load fine

 

 

ErrorMessage(2).pngErrorMessage.png

 

0 Likes
Accepted solutions (1)
5,177 Views
3 Replies
Replies (3)
Message 2 of 4

jeremytammik
Autodesk
Autodesk
Accepted solution

The error message says that this DLL is not a valid .NET assembly.

 

That is very probably correct.

 

Why are you trying to reference this DLL?

 

You probably should not.

 

I think all the assemblies that can possibly be of interest to you and your add-in are named RevitAPI*.dll:

 

C:\Program Files\Autodesk\Revit 2021>dir RevitAPI*dll

 Directory of C:\Program Files\Autodesk\Revit 2021

07/09/2020  09:43 AM        27,231,120 RevitAPI.dll
07/09/2020  03:44 PM            80,272 RevitAPIBrowserUtils.dll
07/09/2020  03:42 PM           973,200 RevitAPIFoundation.dll
07/09/2020  03:43 PM           371,088 RevitAPIIFC.dll
07/09/2020  03:43 PM            31,120 RevitAPILink.dll
07/09/2020  03:44 PM           103,312 RevitAPIMacros.dll
07/09/2020  03:43 PM           540,048 RevitAPIMacrosInterop.dll
07/09/2020  03:44 PM           545,168 RevitAPIMacrosInteropAPI.dll
07/09/2020  03:43 PM           242,064 RevitAPISteel.dll
07/09/2020  03:44 PM         2,517,904 RevitAPIUI.dll
07/09/2020  03:44 PM            62,864 RevitAPIUILink.dll
07/09/2020  03:44 PM            83,344 RevitAPIUIMacros.dll
07/09/2020  03:44 PM           253,328 RevitAPIUIMacrosInterop.dll
07/09/2020  03:44 PM           452,496 RevitAPIUIMacrosInteropAPI.dll
              14 File(s)     33,487,328 bytes

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 3 of 4

aclarke
Advocate
Advocate

Thanks Jeremy

I don't know why I am trying to reference this DLL, I think because it was part of a some code I copied in the beginning and thought it was required and it is part of my template and notes.  And VS2017 let me do it, so...

 

I also thought the (using statement) was pulled from this RevitDB.dll file.

using Autodesk.Revit.DB 

 

Each question is an opportunity to learn a new thing...  sometimes I just push buttons until it works,

thank you sir

Message 4 of 4

jeremytammik
Autodesk
Autodesk

Thank you for your appreciation.

 

That sounds like an efficient approach  🙂

 

I believe the namespace Autodesk.Revit.DB is defined by RevitAPI.dll.

 

I believe that you can safely remove RevitDB.dll from your references.

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder