Autodesk.Windows reference missing

Autodesk.Windows reference missing

Anonymous
Not applicable
9,544 Views
7 Replies
Message 1 of 8

Autodesk.Windows reference missing

Anonymous
Not applicable

Hello all, yesterday, the below worked and has done for years, today code will not compile stating Autodesk.Windows "The type or namespace name 'Windows' does not exist in the namespace 'Autodesk' (are you missing an assembly reference?)", anyone else had this??? Using windows 10.

foreach (Autodesk.Windows.RibbonTab tab in Autodesk.Windows.ComponentManager.Ribbon.Tabs)

0 Likes
Accepted solutions (1)
9,545 Views
7 Replies
Replies (7)
Message 2 of 8

Anonymous
Not applicable
Accepted solution

Ignore, was missing the AdWindows dll from C:\Program Files\Autodesk\Revit yyyy. Somehow it was removed from my solution...

Message 3 of 8

John.mcquaidL8BSD
Explorer
Explorer

You're my hero. I am new to .net programming, as well as programming itself, so I am not sure where and how to learn all the APIs. I was searching for what .dll to reference into my project for, what feels like, forever. I knew I needed Autodesk.Windows, but all my google searches were returning nothing useful. If you, or anyone else, know(s) a good resource for Autodesk .net programming then would you mind telling me. Thank you!

0 Likes
Message 4 of 8

Jaime_Alonso
Enthusiast
Enthusiast

Hey,

I have the same problem. What was the using statement to get the references working?

Thanks

0 Likes
Message 5 of 8

zefreestijl
Advocate
Advocate

hi, this reply might be a little too late,

 

It's AdWindows.dll, should be on the same file path as RevitAPI & RevitAPIUI

 

I was facing the same issue today, 

after a few months away from my RevitAPI code,

I forgot how I can re-reference the missing library..

fortunately the file still recorded on the Recent page..

 

zefreestijl_0-1645060730828.png

 

Still have no idea what caused this problem though.

Message 6 of 8

ricaun
Advisor
Advisor

You could use the package Revit_All_Main_Versions_API_x64 .

Includes these assemblies:

  • RevitAPI.dll
  • RevitAPIUI.dll
  • AdWindows.dll
  • UIFramework.dll

 

Something like this on the csproj for the Revit 2021.

<ItemGroup>
  <PackageReference Include="Revit_All_Main_Versions_API_x64" Version="2021.*" IncludeAssets="build; compile" PrivateAssets="All" />
</ItemGroup>

 

See yaa!

Luiz Henrique Cassettari

ricaun.com - Revit API Developer

AppLoader EasyConduit WireInConduit ConduitMaterial CircuitName ElectricalUtils

Message 7 of 8

fabian.geroldL3YQU
Community Visitor
Community Visitor

Hi,

I installed "Revit_All_Main_Versions_API_x64" with NuGet.

Now when I go to MyProject->References->"Add Reference", the newly installed package "Revit_All_Main_Versions_API_x64" or "AdWindows.dll" is not available.

 

I tried "Browse" and searched the entire drive C: but nothing is found.

How can I add it to the project?

 

Thanks!

0 Likes
Message 8 of 8

ricaun
Advisor
Advisor

If you installed the Nuget Revit_All_Main_Versions_API_x64 correctly with your right Revit version, your project gonna use the reference inside the package that contains:

 

  • RevitAPI.dll
  • RevitAPIUI.dll
  • AdWindows.dll
  • UIFramework.dll

And you don't need to add any other reference from your installed Revit.

Luiz Henrique Cassettari

ricaun.com - Revit API Developer

AppLoader EasyConduit WireInConduit ConduitMaterial CircuitName ElectricalUtils