Skip to content

Commit 893ff30

Browse files
zeusongitGitHub Enterprise
authored andcommitted
Update DSPythonNet3.csproj
1 parent 3be4e26 commit 893ff30

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

DSPythonNet3/DSPythonNet3.csproj

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<ProjectGuid>{F1541C2D-80A9-4FE7-8D9E-75A8B9FF3479}</ProjectGuid>
44
<OutputType>Library</OutputType>
@@ -14,7 +14,7 @@
1414
<PackageReference Include="DynamoVisualProgramming.Core" Version="$(DynamoPackageVersion)" ExcludeAssets="runtime" />
1515
<PackageReference Include="DynamoVisualProgramming.DynamoServices" Version="$(DynamoPackageVersion)" ExcludeAssets="runtime" />
1616
<PackageReference Include="Python.Included" Version="3.11.6" />
17-
<PackageReference Include="Autodesk.pythonnet" Version="3.1.0-preview*" />
17+
<PackageReference Include="Autodesk.pythonnet" Version="3.1.1-preview*" />
1818
</ItemGroup>
1919
<ItemGroup>
2020
<Compile Update="Properties\Resources.Designer.cs">
@@ -41,6 +41,18 @@
4141
<ItemGroup>
4242
<ProjectReference Include="..\DSPythonNet3Wheels\DSPythonNet3Wheels.csproj" />
4343
</ItemGroup>
44+
<!-- Prevent transitive pythonnet from dropping its Python.Runtime.dll while keeping compile assets -->
45+
<ItemGroup>
46+
<PackageReference Update="pythonnet" ExcludeAssets="all" />
47+
</ItemGroup>
48+
49+
<!-- As a safeguard, remove any Python.Runtime coming from NuGet packages from being copied to output -->
50+
<Target Name="RemoveTransitivePythonNetRuntime" AfterTargets="ResolveReferences">
51+
<ItemGroup>
52+
<ReferenceCopyLocalPaths Remove="@(ReferenceCopyLocalPaths)" Condition="'%(ReferenceCopyLocalPaths.FileName)' == 'Python.Runtime' and $([System.String]::Copy('%(ReferenceCopyLocalPaths.Identity)').ToLower().Contains('nuget\\packages\\pythonnet'))" />
53+
</ItemGroup>
54+
</Target>
55+
4456
<ItemGroup>
4557
<None Update="pkg.json">
4658
<TargetPath>..\%(Filename)%(Extension)</TargetPath>

0 commit comments

Comments
 (0)