Skip to content
This repository has been archived by the owner on Jun 30, 2023. It is now read-only.

Moq4 compiled in debug mode? #6

Closed
kendallb opened this issue Sep 4, 2017 · 5 comments
Closed

Moq4 compiled in debug mode? #6

kendallb opened this issue Sep 4, 2017 · 5 comments

Comments

@kendallb
Copy link

kendallb commented Sep 4, 2017

Hi Guys,

I am having issues with Moq4 as I recently moved up to it from Moq3 via NuGet, but it appears the NuGet package was compiled with debugging turned on so Visual Studio keeps trying to find the source files under the c:\projects\moq4 directory, which of course I do not have.

This is extremely annoying when trying to debug unit tests, so is there a way to turn this off or can the project be compiled in release mode with debugging information so it works the way it used to?

@stakx
Copy link
Member

stakx commented Sep 23, 2017

@kendallb, you're asking at the wrong repository, Moq 4.x is over at moq/moq4. This here is the repo for Moq vNext.

@stakx
Copy link
Member

stakx commented Sep 23, 2017

That said, you need to simply adjust your VS debugger settings under Tools > Options. Do either of those:

  • Enable SourceLink support. Then, instead of just complaining that there are no files under that path, the debugger will automatically fetch them from GitHub and allow you to step into it.

  • Enable Just My Code. This should make the debugger ignore Moq's debug symbols completely.

@kendallb
Copy link
Author

I will ask the question on the moq4 area, but I already have Just My Code enabled. The core issue is the NuGet package is compiled in full debug mode from the way it is behaving. It is one thing to include PDB symbols but another to compile in full debug mode where it will try to find source files on your local system.

@kendallb
Copy link
Author

Well I turned on source symbol support in VS2015 and it simply crashed trying to find the source files.

But at the end of the day IMHO this is wrong. Moq is a mocking engine so when I am debugging my unit tests the last thing I want to do when I step into something that Moq is hiding in front of as a proxy is to be suddenly debugging into the Moq code itself? I don't care about the Moq code at that point, I just want to step into the function on the other end of the proxy that is my test function.

This is how it used to work in Moq so IMHO this a step backwards.

@stakx
Copy link
Member

stakx commented Oct 12, 2017

@kendallb - Please let's move this discussion to devlooped/moq#483.

@kzu kzu closed this as completed Dec 27, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants