Last active
May 8, 2025 17:31
-
-
Save ricaun/b5b1d212238e277c5df46221f6d0834b to your computer and use it in GitHub Desktop.
Copy BundleFiles Target for Autodesk AutoCAD
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<CopyBundleFiles>true</CopyBundleFiles> | |
</PropertyGroup> | |
<PropertyGroup> | |
<BundleDestinationFolder>$(AppData)\Autodesk\ApplicationPlugins\$(MSBuildProjectName).bundle</BundleDestinationFolder> | |
</PropertyGroup> | |
<Target Name="_CopyBundleFiles" AfterTargets="Build" Condition="$(CopyBundleFiles) and $(TargetFramework) != ''"> | |
<ItemGroup> | |
<PackageContentsFile Include="$(ProjectDir)\PackageContents.xml" /> | |
<BundleItems Include="$(OutputPath)**\*" /> | |
</ItemGroup> | |
<Copy SourceFiles="@(BundleItems)" SkipUnchangedFiles="false" DestinationFolder="$(BundleDestinationFolder)\%(RecursiveDir)" ContinueOnError="true" Retries="1" /> | |
<Copy SourceFiles="@(PackageContentsFile)" SkipUnchangedFiles="false" DestinationFolder="$(BundleDestinationFolder)" ContinueOnError="true" /> | |
<Message Text="$(MSBuildProjectName) -> $(BundleDestinationFolder) -> [@(BundleItems -> '%(Filename)%(Extension)', ', ')] ($(TargetFramework)) " Importance="high" /> | |
</Target> | |
<Target Name="_CleanBundleFiles" AfterTargets="Clean" Condition="$(CopyBundleFiles) and $(TargetFramework) != ''"> | |
<RemoveDir Directories="$(BundleDestinationFolder)" ContinueOnError="true" /> | |
<Delete Files="$(BundleDestinationFolder)\PackageContents.xml" ContinueOnError="true" /> | |
</Target> | |
</Project> |
AutoCADVersion
to AutoCADInternalVersion
<PropertyGroup>
<AutoCADInternalVersion Condition="$(AutoCADVersion) == 2019">23.0</AutoCADInternalVersion>
<AutoCADInternalVersion Condition="$(AutoCADVersion) == 2020">23.1</AutoCADInternalVersion>
<AutoCADInternalVersion Condition="$(AutoCADVersion) == 2021">24.0</AutoCADInternalVersion>
<AutoCADInternalVersion Condition="$(AutoCADVersion) == 2022">24.1</AutoCADInternalVersion>
<AutoCADInternalVersion Condition="$(AutoCADVersion) == 2023">24.2</AutoCADInternalVersion>
<AutoCADInternalVersion Condition="$(AutoCADVersion) == 2024">24.3</AutoCADInternalVersion>
<AutoCADInternalVersion Condition="$(AutoCADVersion) == 2025">25.0</AutoCADInternalVersion>
<AutoCADInternalVersion Condition="$(AutoCADVersion) == 2026">25.1</AutoCADInternalVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AutoCAD.NET" Version="$(AutoCADInternalVersion).*" IncludeAssets="build; compile" PrivateAssets="All" />
</ItemGroup>
Which Edition of Microsoft Visual Studio to Use (.NET)
COM Interoperability (.NET)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
PackageContents.xml
LoadOnAppearance
is used to force to load when AutoCAD is already open.