Resharper internal error when debugging in 64bits and using SMO APIs - resharper

If I debug some unit tests with Resharper, and those unit tests use the SMO SDK, I get this error:
Any idea how to avoid it? I'm running ReSharper 6.1.37.86 (Full Edition)
UPDATE: After upgrading to Resharper 6.1.1000.82, I get a slightly different error:
Filed in JetBrain's issue tracker: http://youtrack.jetbrains.com/issue/RSRP-326369

I managed to find a two-step workaround:
Use .NET 3.5, not .NET 4.0.
After this change, debugger stopped crashing. However, it still was very slow, and sometimes my breakpoints were not hit. The second step that needs to be done for this workaround to make your debugger fully work is:
Go to Properties of your .NET project, "Debug" tab, disable the option "Enable the Visual Studio hosting process"
An example of the effect these two changes have in your project files is this diff:
https://github.com/7digital/DatabaseMigraine/commit/badfebce83a1c4e39ddfce8a707b0e0ca62ad5a0

Related

Resharper output window not showing steps anymore

Recently we had a change to our Xunit and we upgraded to Xunit 2.0 and all projects to .NET 4.5. Before this change,when I ran the feature file, I remember seeing the steps on the output window (of Resharper unit test session) of a failed test and it would pinpoint where the test failed at. But now, it only shows what kind of error it is and no steps in the output pane.
Can anyone tell me how to get the steps back as it is very annoying and difficult to find out where the test failed.
Note: We are using specflow to write the tests and run them using Resharper. The version of Resharper I am using is 8.2.1000
Support for XUnit 2.0 does not exist in Specflow yet. There is an outstanding pull request, but it still has some issues I think. So I think your options are to revert to the previous version of XUnit or roll up your sleeves and contrbute to the open PR.

NUnit has stopped working in Visual Studio

I am running NUnit 2.6.3 in VS2012 with NUnit Test Adapater 1.1.0.0, on 64 bit Windows 7. The project is C# winforms.
My project's unit tests have stopped running from within VS. I can launch NUnit directly and run the project OK, but running or debugging tests from within VS just greys them out with this message in the output window:
No test is available in
[Your Output Path].
Make sure that installed test discoverers & executors, platform &
framework version settings are appropriate and try again.
Any pointers of what that means? Where can I find the "platform and framework version settings" - does it refer to NUnit settings, project settings, VS settings, or one of the NUnit plugin settings?
I think that it's related to me updating to the latest version of the Test Adapter, but unfortunately I'm not sure :(
Have fixed it by:
- Updating my project target to .NET framework 4.5 from 3.5 (which my project was in - not my choice!). I cannot find any documentation stating this as a limitation, so perhaps it's a bug.
(I have also changed to using NuGet to install NUnit to the project instead of the VS plugin, but I'm not sure that had an effect).
I had a similar problem but when I tried to run my tests just showed that yellow inconclusive circle.
I ended up solving my problem by going into the bin folder for my project, deleting the NUnit framework dll files and then re-running the tests. Worked like a charm.

NUnit not loading latest version of a Console Application

I am re-writing a console application and trying to use Unit Tests. I'm using NUnit, C#, .NET Framework 4 in Visual Studio 2010 on a Windows 7 PC.
When I change code within the application my unit tests don't pick up the latest changes. I can see that NUnit is reloading but for some reason it's not getting the latest version. The only way to get NUnit to work with the latest version is to remove the reference to the Console app, add it back and compile.
Is there a way to avoid doing this? I think the problem is that the the console app is compiled as an EXE, whereas with most applications I've unit-tested they have tended to be DLLs.
EDIT
I had hoped that this question: Unit Testing a Console Application inside Visual Studio contained the answer. If you look at the accepted answer this was the way I'd been proceeding but my test project wasn't picking up the changes. I've now created a class library and I'm applying my tests to that. My console app will simply load, then call, this class library.
Second Edit
I've now got my code to a stage where I can test functionality and I've noticed the same problem with my console app. Although it 'says' it is referencing the compiled DLL, it only picks up the latest change when I delete and re-attach the reference. So, I'm thinking that the problem isn't necessarily connected to NUnit, rather an issue/quirk with console apps.

Is code coverage available in VS2012 for metro-style apps?

I am using Windows 8 Pro and Visual Studio 2012 Ultimate (both RTM).
I create a Metro-style class library, and then a corresponding unit test library. Both target WinRT (not the .NET framework).
I can run unit tests fine, but when I attempt to "Analyze code coverage for all tests", the output window comes up with the results of the rebuild, and that's it. The Code Coverage Results window is all grayed out.
From reading on the web, some have alluded to the idea that code coverage is not enabled for WinRT assemblies, but I cannot confirm. I have also tried creating a .testsettings file, like was needed in VS2010 and explicitly turn on code coverage, and I got the same results.
Can anyone confirm or deny that code coverage is not available for WinRT-targeted assemblies, in VS2012 RTM?? I'm just trying to figure out if I'm missing some setting - or if it's not possible.
It's not possible at this stage due to the sandboxed nature of WinRT apps.
P.S. It's on the list of things the team is looking to resolve in the near future (no, I don't have a timeframe for it)

Running Resharper code analysis outside of Visual Studio

Resharper includes various analysis rules which can be run on your solution from inside Visual Studio but is it possible to run these from say the commandline or as part of your autobuild? Resharper seems to be focused on running in Visual Studio but can it be invoked on solution or project files from outside the IDE?
UPDATE: Seems like TeamCity 7.0 EAP includes a way to execute the code-analysis while building
(blog post) so at least it can somehow be invoked and utilized as part of a CI process.
No, this feature is not currently offered by ReSharper. There is a thread on the JetBrains website related to this question and it can be found here.
Here's a quote:
Currently ReSharper has no interface
from running in a standalone batch
application. However, it is possible
to write such an application that
provides the functionality you're
looking for using ReSharper OpenAPI.
So apparently you could use the ReSharper OpenAPI to create the functionality you want; unfortunately, I haven't had any experience in using it so I'm not much help there.
Some links of interest...
ReSharper OpenAPI Developer Community
ReSharper public API and sample source code (aka. ReSharper PowerToys)
I think you want the functionality provided by fxCop. I am not aware of Resharper functioning outside of Visual Studio.
Looks like they're listening! First version available as a 30-day demo now: http://blogs.jetbrains.com/dotnet/2013/03/resharper-code-analysis-goes-beyond-visual-studio/
If you're looking for compliance of code to standards, take a look at StyleCop. You can tie it into msbuild and run the rules outside of the IDE.
No, it can not be run from commandline. I still hope that they add this feature since I requested it last october :)

Resources