<?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: .NET 8 migration in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/net-8-migration/m-p/13303739#M1136</link>
    <description>&lt;P&gt;Well, then. Please do not struggle or fight. Go with the flow. Maybe back to the basics, e.g., the blog post:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/2024/04/migrating-from-net-48-to-net-core-8.html" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/2024/04/migrating-from-net-48-to-net-core-8.html&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That in turn points back to a discussion here in the forum in which several experienced developers share their approaches:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://forums.autodesk.com/t5/revit-api-forum/optimal-add-in-code-base-approach-to-target-multiple-revit/m-p/12532755/highlight/true#M76622" target="_blank"&gt;https://forums.autodesk.com/t5/revit-api-forum/optimal-add-in-code-base-approach-to-target-multiple-revit/m-p/12532755&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your current solution does not work, I would ditch it and take a look at the other suggestions that might just work right out of the box.&lt;/P&gt;
&lt;P&gt;&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>Thu, 06 Feb 2025 14:27:47 GMT</pubDate>
    <dc:creator>jeremy_tammik</dc:creator>
    <dc:date>2025-02-06T14:27:47Z</dc:date>
    <item>
      <title>.NET 8 migration</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/net-8-migration/m-p/13301211#M1130</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently I have completed the migration from .NET 4.8 to .NET 8 and I am able to load and use the migrated project in Revit 2025 but not in older versions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do I have to use separate project/solution for the purpose of using my code in&amp;nbsp;Revit 2025?&lt;/P&gt;&lt;P&gt;Or in other words, is there a way to use the existing solution without duplicating my code for both cases:&lt;/P&gt;&lt;P&gt;Revit &amp;lt;= 2024&lt;/P&gt;&lt;P&gt;Revit &amp;gt;= 2025&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2025 12:53:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/net-8-migration/m-p/13301211#M1130</guid>
      <dc:creator>amir.dU8TAR</dc:creator>
      <dc:date>2025-02-05T12:53:35Z</dc:date>
    </item>
    <item>
      <title>Re: .NET 8 migration</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/net-8-migration/m-p/13301618#M1131</link>
      <description>&lt;P&gt;Yes, this topic has been discussed and solutions presented both here in this forum and elsewhere, e.g., on GitHub. Have you searched for any of those? I could do so for you, but I am lazy, so I prefer to ask Gemini instead, &lt;A href="https://thebuildingcoder.typepad.com/blog/2025/01/access-to-uiapplication-tags-and-llm-api-support.html#2" target="_blank"&gt;as I described in my blog&lt;/A&gt;. Here is the response I get:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;DIV id="model-response-message-contentr_e5b86e9597e681f6" class="markdown markdown-main-panel stronger" dir="ltr"&gt;
&lt;P data-sourcepos="1:1-1:304"&gt;Let's tackle this dual .NET framework Revit add-in challenge for Revit 2025 and earlier versions. You're on the right track wanting to avoid code duplication – maintaining two separate projects is a real headache. Here's a breakdown of the best approach, combining best practices and practical examples.&lt;/P&gt;
&lt;P data-sourcepos="3:1-3:44"&gt;&lt;STRONG&gt;The Core Problem: .NET Version Conflicts&lt;/STRONG&gt;&lt;/P&gt;
&lt;P data-sourcepos="5:1-5:239"&gt;Revit 2025 requires .NET 8, while older versions rely on earlier .NET frameworks (e.g., .NET 4.8 for Revit 2024 and earlier). Directly compiling a .NET 8 add-in won't work with older Revit versions because they lack the necessary runtime.&lt;/P&gt;
&lt;P data-sourcepos="7:1-7:63"&gt;&lt;STRONG&gt;The Solution: Conditional Compilation and Target Frameworks&lt;/STRONG&gt;&lt;/P&gt;
&lt;P data-sourcepos="9:1-9:211"&gt;The most elegant solution is to use a single project with conditional compilation and multiple target frameworks. This allows you to build &lt;EM&gt;one&lt;/EM&gt; codebase that produces separate DLLs for different Revit versions.&lt;/P&gt;
&lt;P data-sourcepos="11:1-11:36"&gt;&lt;STRONG&gt;1. Project Setup (Visual Studio)&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL data-sourcepos="13:1-15:0"&gt;
&lt;LI data-sourcepos="13:1-13:96"&gt;&lt;STRONG&gt;Create a New Revit Add-in Project:&lt;/STRONG&gt; Start with a standard Revit add-in project template.&lt;/LI&gt;
&lt;LI data-sourcepos="14:1-15:0"&gt;&lt;STRONG&gt;Modify the Project File (.csproj):&lt;/STRONG&gt; This is where the magic happens. You'll add multiple target frameworks and conditional compilation directives. Here's an example:&lt;/LI&gt;
&lt;/UL&gt;
&lt;DIV class="code-block ng-tns-c732780865-20 ng-trigger ng-trigger-codeBlockRevealAnimation"&gt;
&lt;DIV class="code-block-decoration header-formatted gds-title-s ng-tns-c732780865-20 ng-star-inserted"&gt;&lt;SPAN class="ng-tns-c732780865-20"&gt;XML&lt;/SPAN&gt;
&lt;DIV class="buttons ng-tns-c732780865-20 ng-star-inserted"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="formatted-code-block-internal-container ng-tns-c732780865-20"&gt;
&lt;DIV class="animated-opacity ng-tns-c732780865-20"&gt;
&lt;PRE class="ng-tns-c732780865-20"&gt;&lt;CODE class="code-container formatted ng-tns-c732780865-20" role="text" data-test-id="code-content" data-sourcepos="16:1-39:15"&gt;&lt;SPAN class="hljs-tag"&gt;&amp;lt;&lt;SPAN class="hljs-name"&gt;Project&lt;/SPAN&gt; &lt;SPAN class="hljs-attr"&gt;Sdk&lt;/SPAN&gt;=&lt;SPAN class="hljs-string"&gt;"Microsoft.NET.Sdk"&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;

  &lt;SPAN class="hljs-tag"&gt;&amp;lt;&lt;SPAN class="hljs-name"&gt;PropertyGroup&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class="hljs-tag"&gt;&amp;lt;&lt;SPAN class="hljs-name"&gt;TargetFrameworks&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;net48;net8.0&lt;SPAN class="hljs-tag"&gt;&amp;lt;/&lt;SPAN class="hljs-name"&gt;TargetFrameworks&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;  &lt;SPAN class="hljs-tag"&gt;&amp;lt;&lt;SPAN class="hljs-name"&gt;AssemblyName&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;MyRevitAddin&lt;SPAN class="hljs-tag"&gt;&amp;lt;/&lt;SPAN class="hljs-name"&gt;AssemblyName&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class="hljs-tag"&gt;&amp;lt;&lt;SPAN class="hljs-name"&gt;&lt;SPAN class="citation-0"&gt;OutputType&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="citation-0"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="citation-0"&gt;Library&lt;/SPAN&gt;&lt;SPAN class="hljs-tag"&gt;&lt;SPAN class="citation-0"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class="hljs-name"&gt;&lt;SPAN class="citation-0"&gt;OutputType&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="citation-0"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
    &lt;SPAN class="hljs-tag"&gt;&lt;SPAN class="citation-0"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="hljs-name"&gt;&lt;SPAN class="citation-0"&gt;GenerateAssemblyInfo&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="citation-0"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="citation-0"&gt;false&lt;/SPAN&gt;&lt;SPAN class="hljs-tag"&gt;&lt;SPAN class="citation-0"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class="hljs-name"&gt;&lt;SPAN class="citation-0"&gt;GenerateAssemblyInfo&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="citation-0"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="hljs-tag"&gt;&lt;SPAN class="citation-0"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class="hljs-name"&gt;&lt;SPAN class="citation-0"&gt;PropertyGroup&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="citation-0"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;

  &lt;SPAN class="hljs-tag"&gt;&lt;SPAN class="citation-0"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="hljs-name"&gt;&lt;SPAN class="citation-0"&gt;ItemGroup&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="citation-0"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
    &lt;SPAN class="hljs-tag"&gt;&lt;SPAN class="citation-0"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="hljs-name"&gt;&lt;SPAN class="citation-0"&gt;Reference&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="hljs-attr"&gt;&lt;SPAN class="citation-0"&gt;Include&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="citation-0"&gt;=&lt;/SPAN&gt;&lt;SPAN class="hljs-string"&gt;&lt;SPAN class="citation-0"&gt;"RevitAPI"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="citation-0"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
      &lt;SPAN class="hljs-tag"&gt;&amp;lt;&lt;SPAN class="hljs-name"&gt;HintPath&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;$(RevitAPIDLLPath)\RevitAPI.dll&lt;SPAN class="hljs-tag"&gt;&amp;lt;/&lt;SPAN class="hljs-name"&gt;HintPath&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;  &lt;SPAN class="hljs-tag"&gt;&amp;lt;/&lt;SPAN class="hljs-name"&gt;Reference&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class="hljs-tag"&gt;&amp;lt;&lt;SPAN class="hljs-name"&gt;Reference&lt;/SPAN&gt; &lt;SPAN class="hljs-attr"&gt;Include&lt;/SPAN&gt;=&lt;SPAN class="hljs-string"&gt;"RevitAPIUI"&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;
      &lt;SPAN class="hljs-tag"&gt;&amp;lt;&lt;SPAN class="hljs-name"&gt;HintPath&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;$(RevitAPIDLLPath)\RevitAPIUI.dll&lt;SPAN class="hljs-tag"&gt;&amp;lt;/&lt;SPAN class="hljs-name"&gt;HintPath&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class="hljs-tag"&gt;&amp;lt;/&lt;SPAN class="hljs-name"&gt;Reference&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class="hljs-tag"&gt;&amp;lt;/&lt;SPAN class="hljs-name"&gt;ItemGroup&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;

  &lt;SPAN class="hljs-tag"&gt;&amp;lt;&lt;SPAN class="hljs-name"&gt;PropertyGroup&lt;/SPAN&gt; &lt;SPAN class="hljs-attr"&gt;Condition&lt;/SPAN&gt;=&lt;SPAN class="hljs-string"&gt;"'$(TargetFramework)' == 'net48'"&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class="hljs-tag"&gt;&amp;lt;&lt;SPAN class="hljs-name"&gt;DefineConstants&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;REVIT2024_OR_EARLIER&lt;SPAN class="hljs-tag"&gt;&amp;lt;/&lt;SPAN class="hljs-name"&gt;DefineConstants&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;  &lt;SPAN class="hljs-tag"&gt;&amp;lt;&lt;SPAN class="hljs-name"&gt;OutputPath&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;bin\$(Configuration)\$(Platform)\net48\&lt;SPAN class="hljs-tag"&gt;&amp;lt;/&lt;SPAN class="hljs-name"&gt;OutputPath&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="hljs-tag"&gt;&amp;lt;/&lt;SPAN class="hljs-name"&gt;PropertyGroup&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;

  &lt;SPAN class="hljs-tag"&gt;&amp;lt;&lt;SPAN class="hljs-name"&gt;PropertyGroup&lt;/SPAN&gt; &lt;SPAN class="hljs-attr"&gt;Condition&lt;/SPAN&gt;=&lt;SPAN class="hljs-string"&gt;"'$(TargetFramework)' == 'net8.0'"&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class="hljs-tag"&gt;&amp;lt;&lt;SPAN class="hljs-name"&gt;DefineConstants&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;REVIT2025_OR_LATER&lt;SPAN class="hljs-tag"&gt;&amp;lt;/&lt;SPAN class="hljs-name"&gt;DefineConstants&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;  &lt;SPAN class="hljs-tag"&gt;&amp;lt;&lt;SPAN class="hljs-name"&gt;OutputPath&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;bin\$(Configuration)\$(Platform)\net8.0\&lt;SPAN class="hljs-tag"&gt;&amp;lt;/&lt;SPAN class="hljs-name"&gt;OutputPath&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="hljs-tag"&gt;&amp;lt;/&lt;SPAN class="hljs-name"&gt;PropertyGroup&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;

  &lt;SPAN class="hljs-tag"&gt;&amp;lt;/&lt;SPAN class="hljs-name"&gt;Project&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P data-sourcepos="41:1-41:38"&gt;&lt;STRONG&gt;2. Conditional Compilation in Code&lt;/STRONG&gt;&lt;/P&gt;
&lt;P data-sourcepos="43:1-43:141"&gt;Now, use the defined preprocessor symbols (&lt;CODE&gt;REVIT2024_OR_EARLIER&lt;/CODE&gt; and &lt;CODE&gt;REVIT2025_OR_LATER&lt;/CODE&gt;) in your C# code to handle version-specific logic:&lt;/P&gt;
&lt;DIV class="code-block ng-tns-c732780865-21 ng-trigger ng-trigger-codeBlockRevealAnimation"&gt;
&lt;DIV class="code-block-decoration header-formatted gds-title-s ng-tns-c732780865-21 ng-star-inserted"&gt;&lt;SPAN class="ng-tns-c732780865-21"&gt;C#&lt;/SPAN&gt;
&lt;DIV class="buttons ng-tns-c732780865-21 ng-star-inserted"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="formatted-code-block-internal-container ng-tns-c732780865-21"&gt;
&lt;DIV class="animated-opacity ng-tns-c732780865-21"&gt;
&lt;PRE class="ng-tns-c732780865-21"&gt;&lt;CODE class="code-container formatted ng-tns-c732780865-21" role="text" data-test-id="code-content" data-sourcepos="45:1-74:1"&gt;&lt;SPAN class="hljs-keyword"&gt;using&lt;/SPAN&gt; Autodesk.Revit.UI;
&lt;SPAN class="hljs-keyword"&gt;using&lt;/SPAN&gt; Autodesk.Revit.DB;
&lt;SPAN class="hljs-comment"&gt;// ... other using statements&lt;/SPAN&gt;

&lt;SPAN class="hljs-keyword"&gt;namespace&lt;/SPAN&gt; &lt;SPAN class="hljs-title"&gt;MyRevitAddin&lt;/SPAN&gt;
{
    &lt;SPAN class="hljs-keyword"&gt;public&lt;/SPAN&gt; &lt;SPAN class="hljs-keyword"&gt;class&lt;/SPAN&gt; &lt;SPAN class="hljs-title"&gt;MyAddin&lt;/SPAN&gt; : &lt;SPAN class="hljs-title"&gt;IExternalApplication&lt;/SPAN&gt;
    {
        &lt;SPAN class="hljs-function"&gt;&lt;SPAN class="hljs-keyword"&gt;public&lt;/SPAN&gt; Result &lt;SPAN class="hljs-title"&gt;OnStartup&lt;/SPAN&gt;(&lt;SPAN class="hljs-params"&gt;UIControl application&lt;/SPAN&gt;)&lt;/SPAN&gt;
        {
            &lt;SPAN class="hljs-comment"&gt;// ... common code&lt;/SPAN&gt;

&lt;SPAN class="hljs-meta"&gt;#&lt;SPAN class="hljs-meta-keyword"&gt;if&lt;/SPAN&gt; REVIT2024_OR_EARLIER&lt;/SPAN&gt;
            &lt;SPAN class="hljs-comment"&gt;// Revit 2024 and earlier specific code (e.g., older API calls)&lt;/SPAN&gt;
            TaskDialog.TaskDialog.Show(&lt;SPAN class="hljs-string"&gt;"Message"&lt;/SPAN&gt;, &lt;SPAN class="hljs-string"&gt;"Running in Revit 2024 or earlier"&lt;/SPAN&gt;);
&lt;SPAN class="hljs-meta"&gt;#&lt;SPAN class="hljs-meta-keyword"&gt;elif&lt;/SPAN&gt; REVIT2025_OR_LATER&lt;/SPAN&gt;
            &lt;SPAN class="hljs-comment"&gt;// Revit 2025 specific code (e.g., .NET 8 features, new API calls)&lt;/SPAN&gt;
            TaskDialog.TaskDialog.Show(&lt;SPAN class="hljs-string"&gt;"Message"&lt;/SPAN&gt;, &lt;SPAN class="hljs-string"&gt;"Running in Revit 2025 or later"&lt;/SPAN&gt;);
&lt;SPAN class="hljs-meta"&gt;#&lt;SPAN class="hljs-meta-keyword"&gt;endif&lt;/SPAN&gt;&lt;/SPAN&gt;

            &lt;SPAN class="hljs-comment"&gt;// ... more common code&lt;/SPAN&gt;

            &lt;SPAN class="hljs-keyword"&gt;return&lt;/SPAN&gt; Result.Succeeded;
        }

        &lt;SPAN class="hljs-comment"&gt;// ... other methods&lt;/SPAN&gt;
    }
}
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P data-sourcepos="76:1-76:26"&gt;&lt;STRONG&gt;3. Revit API DLL Paths&lt;/STRONG&gt;&lt;/P&gt;
&lt;P data-sourcepos="78:1-78:97"&gt;The crucial part is setting up the &lt;CODE&gt;$(RevitAPIDLLPath)&lt;/CODE&gt; property. You can do this in a few ways:&lt;/P&gt;
&lt;UL data-sourcepos="80:1-82:0"&gt;
&lt;LI data-sourcepos="80:1-80:264"&gt;&lt;STRONG&gt;Environment Variable:&lt;/STRONG&gt; The cleanest approach. Set a system environment variable named &lt;CODE&gt;RevitAPIDLLPath&lt;/CODE&gt; to the directory containing the Revit API DLLs for &lt;EM&gt;each Revit version&lt;/EM&gt; you want to support. Your code will then automatically pick up the correct path.&lt;/LI&gt;
&lt;LI data-sourcepos="81:1-82:0"&gt;&lt;STRONG&gt;Project Properties:&lt;/STRONG&gt; You can define project-level properties in Visual Studio, but this is less flexible.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P data-sourcepos="83:1-83:20"&gt;&lt;STRONG&gt;4. Build Process&lt;/STRONG&gt;&lt;/P&gt;
&lt;P data-sourcepos="85:1-85:294"&gt;When you build your project, Visual Studio will create separate DLLs in the specified output directories (&lt;CODE&gt;bin\$(Configuration)\$(Platform)\net48\&lt;/CODE&gt; and &lt;CODE&gt;bin\$(Configuration)\$(Platform)\net8.0\&lt;/CODE&gt;). You'll then need to distribute the correct DLL to the appropriate Revit version's AddIns folder.&lt;/P&gt;
&lt;P data-sourcepos="87:1-87:39"&gt;&lt;STRONG&gt;5. Add-in Manifest (for Revit 2025)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P data-sourcepos="89:1-89:243"&gt;For Revit 2025, your add-in manifest file will point to the &lt;CODE&gt;.NET 8.0&lt;/CODE&gt; DLL. For older Revit versions, you'll have a separate manifest pointing to the &lt;CODE&gt;.NET 4.8&lt;/CODE&gt; DLL. You can automate this process with a post-build event in your project file.&lt;/P&gt;
&lt;P data-sourcepos="91:1-91:19"&gt;&lt;STRONG&gt;Key Advantages:&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL data-sourcepos="93:1-96:0"&gt;
&lt;LI data-sourcepos="93:1-93:61"&gt;&lt;STRONG&gt;Single Codebase:&lt;/STRONG&gt; Maintainability is vastly improved.&lt;/LI&gt;
&lt;LI data-sourcepos="94:1-94:70"&gt;&lt;STRONG&gt;Conditional Compilation:&lt;/STRONG&gt; Handle version differences elegantly.&lt;/LI&gt;
&lt;LI data-sourcepos="95:1-96:0"&gt;&lt;STRONG&gt;Organized Output:&lt;/STRONG&gt; Separate DLLs for each Revit version.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P data-sourcepos="97:1-97:34"&gt;&lt;STRONG&gt;Addressing Specific Questions:&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL data-sourcepos="99:1-101:0"&gt;
&lt;LI data-sourcepos="99:1-99:250"&gt;&lt;STRONG&gt;Open Source Template:&lt;/STRONG&gt; While there isn't one single "official" template for this, the principles above are the standard approach. Many open-source Revit add-ins use this technique, so examining their &lt;CODE&gt;.csproj&lt;/CODE&gt; files will be highly beneficial.&lt;/LI&gt;
&lt;LI data-sourcepos="100:1-101:0"&gt;&lt;STRONG&gt;No Code Duplication:&lt;/STRONG&gt; You avoid duplicating your core logic. The conditional compilation handles the small version-specific tweaks.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P data-sourcepos="102:1-102:218"&gt;This detailed approach should give you a robust and maintainable solution for your dual .NET framework Revit add-in. Remember to test thoroughly in all target Revit versions! Let me know if you have any more questions.&lt;/P&gt;
&lt;P data-sourcepos="102:1-102:218"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P data-sourcepos="102:1-102:218"&gt;I hope this helps and leave it up to you to dive in and research deeper if desired or required. Good luck, and please share the final solution that you end up with. Thank you!&lt;/P&gt;
&lt;P data-sourcepos="102:1-102:218"&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 05 Feb 2025 16:02:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/net-8-migration/m-p/13301618#M1131</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2025-02-05T16:02:54Z</dc:date>
    </item>
    <item>
      <title>Re: .NET 8 migration</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/net-8-migration/m-p/13302537#M1132</link>
      <description>&lt;P&gt;can someone create a template for this project and send me please.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2025 23:54:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/net-8-migration/m-p/13302537#M1132</guid>
      <dc:creator>sensiblehira</dc:creator>
      <dc:date>2025-02-05T23:54:11Z</dc:date>
    </item>
    <item>
      <title>Re: .NET 8 migration</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/net-8-migration/m-p/13302632#M1133</link>
      <description>&lt;P&gt;I could not figure out how to set environment variable properly&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2025 02:04:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/net-8-migration/m-p/13302632#M1133</guid>
      <dc:creator>sensiblehira</dc:creator>
      <dc:date>2025-02-06T02:04:28Z</dc:date>
    </item>
    <item>
      <title>Re: .NET 8 migration</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/net-8-migration/m-p/13303150#M1134</link>
      <description>&lt;P&gt;Hi, you can check out this &lt;A href="https://github.com/romangolev/RevitAddinTemplate.Multiversion" target="_blank" rel="noopener"&gt;project&lt;/A&gt; or that&lt;A href="https://www.matterlab.co/post/multiversion-revit-plugins-explained" target="_blank" rel="noopener"&gt;&amp;nbsp;blog&lt;/A&gt; that I found on the internet and they were very useful to me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From my experience, it is very handy to define several project configurations containing the Revit year and then use conditionals in the .csproj file like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;Choose&amp;gt;
	&amp;lt;When Condition="$(Configuration.Contains('2025'))"&amp;gt;
		&amp;lt;PropertyGroup&amp;gt;
			&amp;lt;TargetFramework&amp;gt;net8.0-windows&amp;lt;/TargetFramework&amp;gt;
			&amp;lt;RevitVersion&amp;gt;2025&amp;lt;/RevitVersion&amp;gt;
			&amp;lt;DefineConstants&amp;gt;$(DefineConstants);REVIT_2025_OR_GREATER;REVIT_2024_OR_GREATER;...&amp;lt;/DefineConstants&amp;gt;
		&amp;lt;/PropertyGroup&amp;gt;
	&amp;lt;/When&amp;gt;
	...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Later, you can reuse the Revit version to define the dll locations and where to copy the project output&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;ItemGroup&amp;gt;
	&amp;lt;Reference Include="RevitAPI"&amp;gt;
		&amp;lt;HintPath&amp;gt;...\Autodesk\Revit $(RevitVersion)\RevitAPI.dll&amp;lt;/HintPath&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2025 09:56:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/net-8-migration/m-p/13303150#M1134</guid>
      <dc:creator>mmaso64U7Y</dc:creator>
      <dc:date>2025-02-06T09:56:38Z</dc:date>
    </item>
    <item>
      <title>Re: .NET 8 migration</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/net-8-migration/m-p/13303610#M1135</link>
      <description>&lt;P&gt;Edit: I found the problem and it was in the conditions within the code I provided.&lt;/P&gt;&lt;P&gt;Your solution seems to work for me, thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/824630"&gt;@jeremy_tammik&lt;/a&gt;&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12982947"&gt;@mmaso64U7Y&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you guys for trying to help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am familiar and using configurations &amp;amp; constants in a project, but dealing with .csproj file and multi target frameworks is new to me, so Im probably missing something that im not familiar with.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to applying your suggestions regarding the target frameworks by stating &amp;lt;TargetFrameworks&amp;gt;net8.0-windows;net48&amp;lt;/TargetFrameworks&amp;gt; at the top of my .csproj file and then conditionally depending on the configuration set&amp;nbsp;&amp;lt;TargetFramework&amp;gt;&amp;lt;/TargetFramework&amp;gt; in which I state&amp;nbsp;net8.0-windows or&amp;nbsp;net48.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;now the project does not build for 2025 and still not loading the addin for 2024, what a mess&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, when removing&amp;nbsp;&amp;lt;TargetFrameworks&amp;gt;net8.0-windows;net48&amp;lt;/TargetFrameworks&amp;gt; from the first &amp;lt;PropertyGroup&amp;gt; I am not able to build the project at all, an error being thrown saying the the TargetFramework is ''.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Im adding the&amp;nbsp;.csproj contents, trying to remove as much unnecessary code such as 2019-20223 configs and assemblies references.&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;TargetFrameworks&amp;gt;net8.0-windows;net48&amp;lt;/TargetFrameworks&amp;gt;
    &amp;lt;OutputType&amp;gt;Library&amp;lt;/OutputType&amp;gt;
    &amp;lt;AutoGenerateBindingRedirects&amp;gt;false&amp;lt;/AutoGenerateBindingRedirects&amp;gt;
    &amp;lt;GenerateAssemblyInfo&amp;gt;false&amp;lt;/GenerateAssemblyInfo&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;ImportWindowsDesktopTargets&amp;gt;true&amp;lt;/ImportWindowsDesktopTargets&amp;gt;
    &amp;lt;Configurations&amp;gt;Debug;Debug-Revit2019;Debug-Revit2020;Debug-Revit2021;Debug-Revit2022;Debug-Revit2023;Debug-Revit2024;Release;Release-Revit2019;Release-Revit2020;Release-Revit2021;Release-Revit2022;Release-Revit2023;Release-Revit2024;Debug-Revit2025&amp;lt;/Configurations&amp;gt;
  &amp;lt;/PropertyGroup&amp;gt;
  &amp;lt;PropertyGroup&amp;gt;
    &amp;lt;StartupObject /&amp;gt;
  &amp;lt;/PropertyGroup&amp;gt;
  &amp;lt;PropertyGroup&amp;gt;
    &amp;lt;CopyLocalLockFileAssemblies&amp;gt;true&amp;lt;/CopyLocalLockFileAssemblies&amp;gt;
  &amp;lt;/PropertyGroup&amp;gt;
	&amp;lt;!--2024--&amp;gt;
  &amp;lt;PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug-Revit2024|x64' "&amp;gt;
	  &amp;lt;TargetFramework&amp;gt;net48&amp;lt;/TargetFramework&amp;gt;
    &amp;lt;DebugSymbols&amp;gt;true&amp;lt;/DebugSymbols&amp;gt;
    &amp;lt;OutputPath&amp;gt;bin\x64\Debug-Revit2024\&amp;lt;/OutputPath&amp;gt;
    &amp;lt;DefineConstants&amp;gt;TRACE;DEBUG;NEW_UNITS;LONG_ID;Selection_Refence,RevitLinkGraphicsSettings&amp;lt;/DefineConstants&amp;gt;
    &amp;lt;CodeAnalysisRuleSet&amp;gt;MinimumRecommendedRules.ruleset&amp;lt;/CodeAnalysisRuleSet&amp;gt;
  &amp;lt;/PropertyGroup&amp;gt;
	&amp;lt;!--2025--&amp;gt;
  &amp;lt;PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Revit2025|x64'"&amp;gt;
	  &amp;lt;TargetFramework&amp;gt;net8.0-windows&amp;lt;/TargetFramework&amp;gt;
    &amp;lt;DebugSymbols&amp;gt;true&amp;lt;/DebugSymbols&amp;gt;
    &amp;lt;OutputPath&amp;gt;bin\x64\Debug-Revit2025\&amp;lt;/OutputPath&amp;gt;
    &amp;lt;DefineConstants&amp;gt;TRACE;DEBUG;NEW_UNITS;LONG_ID;Selection_Refence,RevitLinkGraphicsSettings&amp;lt;/DefineConstants&amp;gt;
    &amp;lt;CodeAnalysisRuleSet&amp;gt;MinimumRecommendedRules.ruleset&amp;lt;/CodeAnalysisRuleSet&amp;gt;
  &amp;lt;/PropertyGroup&amp;gt;
	&lt;/LI-CODE&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;</description>
      <pubDate>Thu, 06 Feb 2025 14:17:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/net-8-migration/m-p/13303610#M1135</guid>
      <dc:creator>amir.dU8TAR</dc:creator>
      <dc:date>2025-02-06T14:17:57Z</dc:date>
    </item>
    <item>
      <title>Re: .NET 8 migration</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/net-8-migration/m-p/13303739#M1136</link>
      <description>&lt;P&gt;Well, then. Please do not struggle or fight. Go with the flow. Maybe back to the basics, e.g., the blog post:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/2024/04/migrating-from-net-48-to-net-core-8.html" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/2024/04/migrating-from-net-48-to-net-core-8.html&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That in turn points back to a discussion here in the forum in which several experienced developers share their approaches:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://forums.autodesk.com/t5/revit-api-forum/optimal-add-in-code-base-approach-to-target-multiple-revit/m-p/12532755/highlight/true#M76622" target="_blank"&gt;https://forums.autodesk.com/t5/revit-api-forum/optimal-add-in-code-base-approach-to-target-multiple-revit/m-p/12532755&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your current solution does not work, I would ditch it and take a look at the other suggestions that might just work right out of the box.&lt;/P&gt;
&lt;P&gt;&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>Thu, 06 Feb 2025 14:27:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/net-8-migration/m-p/13303739#M1136</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2025-02-06T14:27:47Z</dc:date>
    </item>
    <item>
      <title>Re: .NET 8 migration</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/net-8-migration/m-p/13309814#M1137</link>
      <description>&lt;P&gt;I was fighting with similar problem and in the end it was easier to make separate solution and just link cs files.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Feb 2025 09:56:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/net-8-migration/m-p/13309814#M1137</guid>
      <dc:creator>MarryTookMyCoffe</dc:creator>
      <dc:date>2025-02-10T09:56:08Z</dc:date>
    </item>
  </channel>
</rss>

