This one has been around for a while. I really want to fix it. I'm fairly certain it's related to the structure of the assembly, perhaps something size related. To date, due to IP constraints, no one has been able to share an assembly with me that can reproduce this problem.
Is there any chance you're able to share this assembly with me?
Aah that's indeed going to be hard for me too, and it seems to be difficult to reproduce in a fresh project. It's indeed related to more than just the offending class, even removing a few random lines of code make it go away.
Dorus wrote:Aah that's indeed going to be hard for me too, and it seems to be difficult to reproduce in a fresh project. It's indeed related to more than just the offending class, even removing a few random lines of code make it go away.
Understood. You can probably work around it just by making unrelated changes in the project, such as adding a dummy class with a few unused methods in it.
I'm hopeful there will one day be an open source project that surfaces this, so I can pin it down and resolve it once and for all.
We've ran in to this on one of our projects. What can we do to help debug?
Happy to run a debug build of ncrunch or something. Sharing the project might be a stretch (it uses an internal nuget feed), but if we really need to we might be able to provide it.
davetorutek wrote:We've ran in to this on one of our projects. What can we do to help debug?
Happy to run a debug build of ncrunch or something. Sharing the project might be a stretch (it uses an internal nuget feed), but if we really need to we might be able to provide it.
To have a chance of solving this issue, I really need to have the actual project itself to be able to solve it.
I might be able to figure it out with just the DLL and PDB, in the form that they exist in the NCrunch workspace. This is assuming your exception is identical to the one at the top of this thread (where it was thrown from the assembly being instrumented, not one of its dependencies). The exception is happening when NCrunch tries to load the DLL, which means that I might be able to set up a test that can surface the issue from the same DLL. It's a hope though (not a promise). There's a lot going on here.