79134981

Date: 2024-10-28 20:19:26
Score: 0.5
Natty:
Report link

OK so I eventually worked out that I needed to add conditions to the references in the csproj file like this:

  <ItemGroup Condition="'$(TargetFramework)|$(Configuration)|$(Platform)'=='net8.0-windows|Debug|x64'">
    <Reference Include="RevitAPI">
      <HintPath>c:\Program Files\Autodesk\Revit 2025\RevitAPI.dll</HintPath>
      <Private>True</Private>
    </Reference>
    <Reference Include="RevitAPIUI">
      <HintPath>c:\Program Files\Autodesk\Revit 2025\RevitAPIUI.dll</HintPath>
      <Private>True</Private>
    </Reference>
  </ItemGroup>

  <ItemGroup Condition="'$(TargetFramework)|$(Configuration)|$(Platform)'=='net481|Debug|x64'">
    <Reference Include="RevitAPI">
      <HintPath>c:\Program Files\Autodesk\Revit 2024\RevitAPI.dll</HintPath>
      <Private>True</Private>
    </Reference>
    <Reference Include="RevitAPIUI">
      <HintPath>c:\Program Files\Autodesk\Revit 2024\RevitAPIUI.dll</HintPath>
      <Private>True</Private>
    </Reference>
  </ItemGroup>
Reasons:
  • Blacklisted phrase (0.5): I need
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: sean2000