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

Debugging TPDTC assemblies loading failures when invoked from .NET Core SDK command line. #245

Closed
dmitry-a-morozov opened this issue Aug 1, 2018 · 2 comments
Labels

Comments

@dmitry-a-morozov
Copy link
Member

It's related to #244
How do I debug TPDTC external assemblies loading failures when type provider triggered from .NET SDK command line?
Usual type provider technique invoking one VS instance from another simply doesn't work because VS uses it's own F# compiler and things are fine.
I tried

  • Invoke dotnet ... as debug target
  • Debugger.Break()
  • printf

Nothing worked.

So I had to go with a low-tech solution writing to file from AsserblyResolve event which is ok-ish but I wonder if there is a better way.

@dsyme dsyme added the bug label Sep 6, 2018
@dsyme
Copy link
Contributor

dsyme commented Sep 12, 2018

@dmitry-a-morozov I would normally do this:

  1. Capture output of msbuild -v:n or msbuild -v:d in args.txt and trim out the rubbish leaving just the command line arguments to the F# compiler, usually starting with -o:

  2. Run an explicit invocation of the compiler using:

    "c:\Program Files\dotnet\dotnet.exe" "C:\Program Files\dotnet\sdk\2.1.401\FSharp\fsc.exe" @args.txt

  3. Debug that invocation using

    devenv /debugexe "c:\Program Files\dotnet\dotnet.exe" "C:\Program Files\dotnet\sdk\2.1.401\FSharp\fsc.exe" @args.txt

    However be careful to make sure Visual Studio debugging type is set to ".NET Core" (right click properties on dotnet and set debug type)

  4. Set first-catch exception handling (Ctrl-Alt-E, select all CLR exceptions) and set Just My Code off

@dsyme
Copy link
Contributor

dsyme commented Sep 12, 2018

Added docs on this to the README.md

@dsyme dsyme closed this as completed Sep 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants