Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically attach debugger to subprocess #15

Merged
merged 4 commits into from
Jul 6, 2022
Merged

Automatically attach debugger to subprocess #15

merged 4 commits into from
Jul 6, 2022

Conversation

stratosblue
Copy link
Contributor

When reference package Tmds.ExecFunction.VsDebugger the subprocess will attach debugger automatically.

Use conditional reference will avoid reference EnvDTE for release.

<ItemGroup Condition="'$(Configuration)' == 'Debug'">
  <ProjectReference Include="..\src\Tmds.ExecFunction.VsDebugger\Tmds.ExecFunction.VsDebugger.csproj" />
</ItemGroup>

@tmds
Copy link
Owner

tmds commented Jul 1, 2022

@stratosblue I missed this PR. The change looks good. Are you still available to address some feedback?

@stratosblue
Copy link
Contributor Author

@tmds Sure, with pleasure

@tmds
Copy link
Owner

tmds commented Jul 4, 2022

style nit: instead of var, can you use the actual type? I'm following style similar to https://github.com/dotnet/runtime/blob/3537bf20373e2c6fd01d4e2d477be1b6d5be51d9/docs/coding-guidelines/coding-style.md?plain=1#L22-L23.

And, optional: it should be possible to include the dll from Tmds.ExecFunction.VsDebugger in the Tmds.ExecFunction package in a way that it gets included in the output only when Configuration == Debug. This can be done using a targets file. See https://stackoverflow.com/questions/60623546/targets-file-for-deploying-nativs-dlls-to-output-directory and similar.
If we can make that work, I'd prefer shipping it like that. I can also look into it myself when this is merged.

@stratosblue
Copy link
Contributor Author

@tmds Such a good idea. Let me try it.

@stratosblue
Copy link
Contributor Author

it seems work

@tmds
Copy link
Owner

tmds commented Jul 5, 2022

We're moving in the right direction, but not there yet.
The nupkg doesn't contain Tmds.ExecFunction.VsDebugger.dll.

Archive:  Tmds.ExecFunction.0.5.1.nupkg
  inflating: _rels/.rels             
  inflating: Tmds.ExecFunction.nuspec  
  inflating: lib/netstandard2.0/Tmds.ExecFunction.dll  
  inflating: build/Tmds.ExecFunction.targets  
  inflating: [Content_Types].xml     
  inflating: package/services/metadata/core-properties/3e3e35d050a9476485e20ded17fc34b1.psmdcp  

@stratosblue
Copy link
Contributor Author

@tmds
I checked it. When run dotnet pack directly. The Tmds.ExecFunction.VsDebugger.dll may not generated before generate package. A simple way to fix it is build before pack. Just like dotnet build -c Release && dotnet pack -c Release

@tmds
Copy link
Owner

tmds commented Jul 5, 2022

I think the issue may be that ..\Tmds.ExecFunction.VsDebugger\bin\$(Configuration)\$(TargetFramework)\**\* is a wildcard and when it gets evaluated the file is not there yet.
Can you change to explicitly have the Tmds.ExecFunction.VsDebugger.dll path, and see if it makes a difference?

@stratosblue
Copy link
Contributor Author

@tmds
It seems you are right. I tested ..\Tmds.ExecFunction.VsDebugger\bin\$(Configuration)\$(TargetFramework)\Tmds.ExecFunction.VsDebugger.dll. The dotnet pack will include Tmds.ExecFunction.VsDebugger.dll in the package.

@tmds tmds merged commit eed2ef6 into tmds:master Jul 6, 2022
@tmds
Copy link
Owner

tmds commented Jul 6, 2022

Thank you @stratosblue.
It seems the Travis CI stuff I had setup here is no longer working. I'll get that sorted out.

Could you then verify a NuGet package from the CI feed works for you as expected in Visual Studio?
I don't have a Windows machine, so I can't check myself.

@stratosblue
Copy link
Contributor Author

I do not found the package at feed. And I has tested at local. It works. Maybe you can publish a preview package first.

@tmds
Copy link
Owner

tmds commented Jul 11, 2022

I've changed to use GitHub CI. You should now be able to pull a package from the CI feed.

There was a regression. The arguments that configured the debugger in the child were passed on to the child function. Fixed by fc0a5f4#diff-2ef9e2ec359ca931a16f18f174fc965a4089e2ae92286dd64d66586885a6738d.

@stratosblue
Copy link
Contributor Author

@tmds
I hava tested 0.5.1-8-fc0a5f4bcffe52a3525763557f949fa2d48c83fa with VisualStudio2022. It works.

@tmds
Copy link
Owner

tmds commented Jul 13, 2022

Thanks!

This is part of 0.6.0 which was just published to nuget.org.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants