<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: VS Code Error in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/vs-code-error/m-p/13750163#M84372</link>
    <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/546841"&gt;@sragan&lt;/a&gt;&amp;nbsp;having no actual experience with macros, i can only offer this as a workaround:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;copy the code in 2024 to a text editor.&lt;/LI&gt;&lt;LI&gt;start new macro in 2025.&lt;/LI&gt;&lt;LI&gt;copy code back to 2025.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;My thought being that at least this will get around the issue of not being able to upgrade as shown in that link.&lt;/P&gt;</description>
    <pubDate>Fri, 01 Aug 2025 15:36:46 GMT</pubDate>
    <dc:creator>ctm_mka</dc:creator>
    <dc:date>2025-08-01T15:36:46Z</dc:date>
    <item>
      <title>VS Code Error</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/vs-code-error/m-p/13750047#M84369</link>
      <description>&lt;P&gt;Trying to update a Macro from Revit 2024 to 2025&amp;nbsp; with the new VS Code enviroment.&amp;nbsp; &amp;nbsp;I copied the macro to the 2025 directory, and hit the Macro Edit Button.&amp;nbsp; &amp;nbsp;When VS Code opens, I type "dotnet build" in the terminal window.&amp;nbsp; The build is successful, but I get a couple of warnings.&amp;nbsp; It looks like somewhere I have references to older Windows Forms and System Drawing DLL's.&amp;nbsp; &amp;nbsp;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.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I fix this?&amp;nbsp; Here is the error message VS Code gives.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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".&lt;BR /&gt;"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.&lt;BR /&gt;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].&lt;BR /&gt;C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Drawing.dll&lt;BR /&gt;Project file item includes which caused reference "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Drawing.dll".&lt;BR /&gt;System.Drawing&lt;BR /&gt;References which depend on or have been unified to "System.Drawing, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" [].&lt;BR /&gt;C:\ProgramData\Autodesk\Revit\Macros\2025\RevitAPI.dll&lt;BR /&gt;Project file item includes which caused reference "C:\ProgramData\Autodesk\Revit\Macros\2025\RevitAPI.dll".&lt;BR /&gt;..\..\..\..\..\RevitAPI.dll&lt;BR /&gt;..\..\..\..\..\RevitAPIUI.dll&lt;BR /&gt;C:\ProgramData\Autodesk\Revit\Macros\2025\RevitAPIUI.dll&lt;BR /&gt;Project file item includes which caused reference "C:\ProgramData\Autodesk\Revit\Macros\2025\RevitAPIUI.dll".&lt;BR /&gt;..\..\..\..\..\RevitAPIUI.dll&lt;BR /&gt;C:\Program Files\dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(2413,5): warning MSB3277:&lt;BR /&gt;Found conflicts between different versions of "System.Windows.Forms" that could not be resolved.&lt;BR /&gt;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".&lt;BR /&gt;"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.&lt;BR /&gt;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].&lt;BR /&gt;C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Windows.Forms.dll&lt;BR /&gt;Project file item includes which caused reference "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Windows.Forms.dll".&lt;BR /&gt;System.Windows.Forms&lt;BR /&gt;References which depend on or have been unified to "System.Windows.Forms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" [].&lt;BR /&gt;C:\ProgramData\Autodesk\Revit\Macros\2025\RevitAPIUI.dll&lt;BR /&gt;Project file item includes which caused reference "C:\ProgramData\Autodesk\Revit\Macros\2025\RevitAPIUI.dll".&lt;BR /&gt;..\..\..\..\..\RevitAPIUI.dll&lt;/P&gt;</description>
      <pubDate>Fri, 01 Aug 2025 14:20:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/vs-code-error/m-p/13750047#M84369</guid>
      <dc:creator>sragan</dc:creator>
      <dc:date>2025-08-01T14:20:58Z</dc:date>
    </item>
    <item>
      <title>Re: VS Code Error</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/vs-code-error/m-p/13750100#M84370</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For Revit 2025, you need to upgrade your solution from NET4.8 to NET CORE 8.0.&lt;/P&gt;
&lt;P&gt;You can look this link :&amp;nbsp;&lt;A href="https://thebuildingcoder.typepad.com/blog/2024/04/migrating-from-net-48-to-net-core-8.html" target="_blank" rel="noopener"&gt;https://thebuildingcoder.typepad.com/blog/2024/04/migrating-from-net-48-to-net-core-8.html&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Aug 2025 14:47:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/vs-code-error/m-p/13750100#M84370</guid>
      <dc:creator>Charles.Piro</dc:creator>
      <dc:date>2025-08-01T14:47:21Z</dc:date>
    </item>
    <item>
      <title>Re: VS Code Error</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/vs-code-error/m-p/13750158#M84371</link>
      <description>&lt;P&gt;There is a whole lot of info. and links in that post, but I don't see anything specific to Revit Macros or the new VS Code Editor Revit 2025 uses.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Probably great for professional programmers, but not so great for others who use Macros for the simplicity.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Aug 2025 15:31:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/vs-code-error/m-p/13750158#M84371</guid>
      <dc:creator>sragan</dc:creator>
      <dc:date>2025-08-01T15:31:28Z</dc:date>
    </item>
    <item>
      <title>Re: VS Code Error</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/vs-code-error/m-p/13750163#M84372</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/546841"&gt;@sragan&lt;/a&gt;&amp;nbsp;having no actual experience with macros, i can only offer this as a workaround:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;copy the code in 2024 to a text editor.&lt;/LI&gt;&lt;LI&gt;start new macro in 2025.&lt;/LI&gt;&lt;LI&gt;copy code back to 2025.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;My thought being that at least this will get around the issue of not being able to upgrade as shown in that link.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Aug 2025 15:36:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/vs-code-error/m-p/13750163#M84372</guid>
      <dc:creator>ctm_mka</dc:creator>
      <dc:date>2025-08-01T15:36:46Z</dc:date>
    </item>
    <item>
      <title>Re: VS Code Error</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/vs-code-error/m-p/13760431#M84427</link>
      <description>&lt;P&gt;Thats's the only way I got it to work.&amp;nbsp; &amp;nbsp;I thought it was going to be a real pain to add windows forms, but I only needed to add one line of code to the csproj file.&amp;nbsp; Like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;&amp;lt;Project Sdk="Microsoft.NET.Sdk"&amp;gt;
  &amp;lt;PropertyGroup&amp;gt;
    &amp;lt;TargetFramework&amp;gt;net8.0-windows&amp;lt;/TargetFramework&amp;gt;
    &amp;lt;ImplicitUsings&amp;gt;enable&amp;lt;/ImplicitUsings&amp;gt;
    &amp;lt;UseWindowsForms&amp;gt;true&amp;lt;/UseWindowsForms&amp;gt;
    &amp;lt;UseWPF&amp;gt;true&amp;lt;/UseWPF&amp;gt;
    &amp;lt;Nullable&amp;gt;enable&amp;lt;/Nullable&amp;gt;
  &amp;lt;/PropertyGroup&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also had to update the AddParameter methods, like this;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;//FamilyParameter fp = famMan.AddParameter (eD,BuiltInParameterGroup.PG_ELECTRICAL_LIGHTING,false); 

becomes:

FamilyParameter fp = famMan.AddParameter (eD,GroupTypeId.ElectricalLighting,false);
                            		}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And there is the usual frustration that&amp;nbsp; usually comes with copying and pasting code&amp;nbsp; - - one "}" always seems to be missing, extra, or just in the wrong place.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But it does work.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Aug 2025 21:19:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/vs-code-error/m-p/13760431#M84427</guid>
      <dc:creator>sragan</dc:creator>
      <dc:date>2025-08-08T21:19:16Z</dc:date>
    </item>
  </channel>
</rss>

