Skip to content

Commit

Permalink
Fix debugging the child process in VS.
Browse files Browse the repository at this point in the history
Using NuGet central package management unintentionally lead to
the removal of the EnvDTE Version attributes in the .targets file.
  • Loading branch information
tmds committed Feb 1, 2024
1 parent d55cbbd commit c9df751
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
4 changes: 3 additions & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<Project>
<ItemGroup>
<PackageVersion Include="EnvDTE" Version="17.8.37221 " />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.6.0" />
<PackageVersion Include="xunit" Version="2.4.2" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.4.5" />

<!-- !! Also update EnvDteVersion in Tmds.ExecFunction.targets. -->
<PackageVersion Include="EnvDTE" Version="17.8.37221" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion src/Tmds.ExecFunction/Tmds.ExecFunction.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netstandard2.0</TargetFramework>
<VersionPrefix>0.7.0</VersionPrefix>
<VersionPrefix>0.7.1</VersionPrefix>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Description>Execute a function in a separate process</Description>
<Authors>Tom Deseyn</Authors>
Expand Down
22 changes: 18 additions & 4 deletions src/Tmds.ExecFunction/Tmds.ExecFunction.targets
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
<Project>
<ItemGroup Condition="'$(Configuration)' == 'Debug'">
<PackageReference Include="EnvDTE" />
<PropertyGroup>
<EnableTmdsExecFunctionVsDebugging Condition="'$(EnableTmdsExecFunctionVsDebugging)' == '' And '$(Configuration)' == 'Debug'">true</EnableTmdsExecFunctionVsDebugging>
<EnvDteVersion Condition="'$(EnvDteVersion)' == ''">17.8.37221</EnvDteVersion>
</PropertyGroup>

<ItemGroup Condition="'$(EnableTmdsExecFunctionVsDebugging)' == 'true' And '$(ManagePackageVersionsCentrally)' != 'true'">
<PackageReference Include="EnvDTE" Exclude="@(PackageReference)" Version="$(EnvDteVersion)" />
</ItemGroup>

<ItemGroup Condition="'$(EnableTmdsExecFunctionVsDebugging)' == 'true' And '$(ManagePackageVersionsCentrally)' == 'true'">
<PackageVersion Include="EnvDTE" Exclude="@(PackageVersion)" Version="$(EnvDteVersion)" />
<PackageReference Include="EnvDTE" Exclude="@(PackageReference)" />
</ItemGroup>

<ItemGroup Condition="'$(EnableTmdsExecFunctionVsDebugging)' == 'true'">
<VsDebuggerFile Include="$(MSBuildThisFileDirectory)\..\tools\any\vsdebugger\**\*" />
</ItemGroup>
<Target Name="CopyVsDebuggerFileOnBuild" Condition="'$(Configuration)' == 'Debug'" BeforeTargets="Build">

<Target Name="CopyVsDebuggerFileOnBuild" Condition="'$(EnableTmdsExecFunctionVsDebugging)' == 'true'" BeforeTargets="Build">
<Copy SourceFiles="@(VsDebuggerFile)" DestinationFolder="$(TargetDir)\" />
</Target>
</Project>
</Project>

0 comments on commit c9df751

Please sign in to comment.