Skip to content

Commit

Permalink
Fix debugging the child process in VS. (#29)
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 authored Feb 1, 2024
1 parent d55cbbd commit bfdf6a9
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>
<EnableExecFunctionVsDebugging Condition="'$(EnableExecFunctionVsDebugging)' == '' And '$(Configuration)' == 'Debug'">true</EnableExecFunctionVsDebugging>
<EnvDTEVersion Condition="'$(EnvDTEVersion)' == ''">17.8.37221</EnvDTEVersion>
</PropertyGroup>

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

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

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

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

0 comments on commit bfdf6a9

Please sign in to comment.