Skip to content

Instantly share code, notes, and snippets.

@ricaun
Created January 9, 2024 19:45
Show Gist options
  • Save ricaun/ebaaa14f9ad487cf7b84aaf39c34f8f2 to your computer and use it in GitHub Desktop.
Save ricaun/ebaaa14f9ad487cf7b84aaf39c34f8f2 to your computer and use it in GitHub Desktop.
Revit 2025 - .NET Core
<!-- Net Core -->
<PropertyGroup Condition="!$(TargetFramework.StartsWith('net4'))">
<EnableDynamicLoading>true</EnableDynamicLoading>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<GenerateDependencyFile>false</GenerateDependencyFile>
</PropertyGroup>
@ricaun
Copy link
Author

ricaun commented Mar 18, 2024

<!-- RevitVersion -->
<PropertyGroup>
  <TargetFrameworks>net46;net47;net48;net8.0-windows</TargetFrameworks>
  <AppendTargetFrameworkToOutputPath>true</AppendTargetFrameworkToOutputPath>
  <ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
</PropertyGroup>
<Choose>
  <When Condition="$(TargetFramework.StartsWith('net46'))">
    <PropertyGroup>
      <RevitVersion>2017</RevitVersion>
    </PropertyGroup>
  </When>
  <When Condition="$(TargetFramework.StartsWith('net47'))">
    <PropertyGroup>
      <RevitVersion>2019</RevitVersion>
    </PropertyGroup>
  </When>
  <When Condition="$(TargetFramework.StartsWith('net48'))">
    <PropertyGroup>
      <RevitVersion>2021</RevitVersion>
    </PropertyGroup>
  </When>
  <Otherwise>
    <PropertyGroup>
      <RevitVersion>2025</RevitVersion>
    </PropertyGroup>
  </Otherwise>
</Choose>

<!-- Net Core -->
<PropertyGroup Condition="!$(TargetFramework.StartsWith('net4'))">
  <EnableDynamicLoading>true</EnableDynamicLoading>
  <GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
  <GenerateDependencyFile>false</GenerateDependencyFile>
</PropertyGroup>

<ItemGroup>
  <PackageReference Include="Newtonsoft.Json" Version="9.*" IncludeAssets="build; compile" PrivateAssets="All">
    <NoWarn>NU1903</NoWarn>
  </PackageReference>
  <PackageReference Include="Revit_All_Main_Versions_API_x64" Version="$(RevitVersion).*-*" IncludeAssets="build; compile" PrivateAssets="All" />
</ItemGroup>

<ItemGroup Condition="!$(TargetFramework.StartsWith('net4'))">
  <PackageReference Include="System.Drawing.Common" Version="7.*" IncludeAssets="build; compile" PrivateAssets="All" />
</ItemGroup>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment