Skip to content

Commit a7cb940

Browse files
authored
Update README.md
1 parent 6a84fe6 commit a7cb940

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,41 @@ It is important that the design-time assemblies you use (if any) are not loaded
201201

202202
That is, an explicit `.nuspec` file will be needed with an explicit `<references>` node (so that only the TPRTC gets added as a reference), see [this example](https://github.com/baronfel/FSharp.Data/blob/e0f133e6e79b4a41365776da51332227dccff9ab/nuget/FSharp.Data.nuspec).
203203

204+
### FAQ
204205

206+
#### How do I debug execution of a type provider when using .NET Framework tools on Windows?
207+
208+
1. Capture output of `msbuild -v:n` in `args.txt` and trim out the rubbish leaving just the command line arguments to the F# compiler, usually starting with `-o:...`
209+
210+
2. Run an explicit invocation of the compiler using this, checking that your failures still happen
211+
212+
fsc.exe @args.txt
213+
214+
Then debug that invocation using
215+
216+
devenv /debugexe fsc.exe @args.txt
217+
218+
If your failures only happen in the IDE then use `devenv /debugexe devenv.exe MyProj.fsproj`, set debug type to ".NET Framework 4.0" and launch F5. Likewise if your failures only happen in F# Interactive then use `devenv /debugexe fsi.exe MyProj.fsproj`.
219+
220+
Set first-catch exception handling (Ctrl-Alt-E, select all CLR exceptions) and set Just My Code off
221+
222+
#### How do I debug execution of a type provider when using .NET Core tools on Windows?
223+
224+
One approach:
225+
226+
1. Capture output of `dotnet build -v:n` in `args.txt` and trim out the rubbish leaving just the command line arguments to the F# compiler, usually starting with `-o:...`
227+
228+
2. Run an explicit invocation of the compiler using:
229+
230+
"c:\Program Files\dotnet\dotnet.exe" "C:\Program Files\dotnet\sdk\2.1.401\FSharp\fsc.exe" @args.txt
231+
232+
Then debug that invocation using
233+
234+
devenv /debugexe "c:\Program Files\dotnet\dotnet.exe" "C:\Program Files\dotnet\sdk\2.1.401\FSharp\fsc.exe" @args.txt
235+
236+
Be careful to make sure Visual Studio debugging type is set to ".NET Core" (right click properties on dotnet and set debug type)
237+
238+
Set first-catch exception handling (Ctrl-Alt-E, select all CLR exceptions) and set Just My Code off.
205239

206240
### Some Type Provider terminology
207241

0 commit comments

Comments
 (0)