- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Trying to update a Macro from Revit 2024 to 2025 with the new VS Code enviroment. I copied the macro to the 2025 directory, and hit the Macro Edit Button. When VS Code opens, I type "dotnet build" in the terminal window. The build is successful, but I get a couple of warnings. It looks like somewhere I have references to older Windows Forms and System Drawing DLL's. The Macro won't run (it still has the red symbol on the icon in the Macro Manager, like it hasn't been successfuly built.)
How do I fix this? Here is the error message VS Code gives.
There was a conflict between "System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" and "System.Drawing, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
"System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" was chosen because it was primary and "System.Drawing, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" was not.
References which depend on "System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" [C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Drawing.dll].
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Drawing.dll
Project file item includes which caused reference "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Drawing.dll".
System.Drawing
References which depend on or have been unified to "System.Drawing, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" [].
C:\ProgramData\Autodesk\Revit\Macros\2025\RevitAPI.dll
Project file item includes which caused reference "C:\ProgramData\Autodesk\Revit\Macros\2025\RevitAPI.dll".
..\..\..\..\..\RevitAPI.dll
..\..\..\..\..\RevitAPIUI.dll
C:\ProgramData\Autodesk\Revit\Macros\2025\RevitAPIUI.dll
Project file item includes which caused reference "C:\ProgramData\Autodesk\Revit\Macros\2025\RevitAPIUI.dll".
..\..\..\..\..\RevitAPIUI.dll
C:\Program Files\dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(2413,5): warning MSB3277:
Found conflicts between different versions of "System.Windows.Forms" that could not be resolved.
There was a conflict between "System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" and "System.Windows.Forms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089".
"System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" was chosen because it was primary and "System.Windows.Forms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" was not.
References which depend on "System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" [C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Windows.Forms.dll].
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Windows.Forms.dll
Project file item includes which caused reference "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Windows.Forms.dll".
System.Windows.Forms
References which depend on or have been unified to "System.Windows.Forms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" [].
C:\ProgramData\Autodesk\Revit\Macros\2025\RevitAPIUI.dll
Project file item includes which caused reference "C:\ProgramData\Autodesk\Revit\Macros\2025\RevitAPIUI.dll".
..\..\..\..\..\RevitAPIUI.dll
Solved! Go to Solution.