1

Using Visual Studio 2013, I have installed FluentAssertions 2.1.0.0 via NuGet into this C# project, but am unable to set breakpoints within FluentAssertions even though I have pointed the debugger to its source code at tag v2.1. How can I successfully set breakpoints within FluentAssertions?

Furthermore, when catching an exception within FluentAssertions (which is why I need to debug it in the first place), the debugger warns that the source code has changed since the assembly was built, even though the source code is of tag v2.1 which should correspond to binary version 2.1.0.0. Therefore I'm not sure if the source code displayed at the origin of the (null reference) exception is correct, I'm not able to pinpoint the cause of the exception either for the life of me.

aknuds1
  • 65,625
  • 67
  • 195
  • 317

1 Answers1

1

It's probably because I've used [DebugNonUserCode] on most of the FA classes.

Dennis Doomen
  • 8,368
  • 1
  • 32
  • 44
  • Any way to work around this?? I wasn't even aware of this attribute until now :) I think I figured out how I was triggering the exception in FA, but it'd still be nice to be able to debug FA properly. – aknuds1 Dec 18 '13 at 08:21
  • 1
    I don't think you can, other than forking the GitHub repository and removing the attributes. – Dennis Doomen Dec 19 '13 at 08:35
  • OK, I can try and see if it makes a difference. The Visual Studio warning doesn't really indicate that non-user code is what is happening however, rather that the source code is different from version 2.1.0.0. Case in point, the debugger stops upon a NullReferenceException within FA, but I can't see that any variables are in fact null. – aknuds1 Dec 19 '13 at 09:52
  • Isn't that because the NuGet version deploys a release build? – Dennis Doomen Dec 21 '13 at 08:23
  • I don't really know? Not familiar enough with the workings of NuGet (or .NET in general) as regards debuggability. – aknuds1 Dec 21 '13 at 12:07