resharper

.net unit test crashes with "Cannot pass a GCHandle across AppDomains" when called from foreign thread.

I am writing a C# unit test to test C++/CLI functionality that involves threads. The C++/CLI code implements a DirectShow filter, the Windows API for rendering movies. This works thus that I create DirectShow objects, I tell it to run an AVI through my C++/CLI filters, waits until rendering is done, and then exits. My filter has a call...

ReSharper: formatting of delegates

I like my code formatted like this: WithDataContext.Execute( delegate(DataContext dataContext) { // code goes here. }); ReSharper wants to auto-format it like this: WithDataContext.Execute( delegate(DataContext dataContext) { ...

Business Case for Resharper

We are trying to get Resharper introduced to our company but it would have to be for all developers. Management want us to justify the cost with a business case. I am unsure how to go about getting proof that Resharper will benefit the business. What kind of statistics can you get from it? Any help with this would be appreciated. ...

Extract method to already existing interface with ReSharper

I'm adding a new method to a class that implements an interface, and I like to use the "Extract Interface" refactoring and just add the method to the interface. But it doesn't seem like ReSharper supports adding a method signature to an already existing interface. It feels like I'm missing something, I'm sure it can be done somehow. May...

Launch Reflector from Visual Studio 2008 References Section in Solution Explorer

How do you configure Visual Studio 2008 to launch the Redgate .Net Reflector from a right click on an assembly in the references section in the solution explorer? I have it set up at the office to do this, so I know it's possible. I do have ReSharper installed but I don't think this is ReSharper functionality. UPDATE This is the func...

Resharper Live Template Macro that changes variable name upon exit

I would like to create a Resharper Live Template that changes all spaces to underscores ind my "fact" Live template variable $testname$: <Fact()> _ Public Sub $testnames$() ' Arrange $END$ ' Act ' Assert End Sub I have this: [Macro("applyRegex", ShortDescription = "Run on {#0:variable}", LongDescription = "")] ...

How to reset the "Don't show this dialog again" settings for Visual Studio and resharper

In a Visual Studio project (C#), I attempted to perform a rename of a namespace using the Resharper shortcut (Ctrl-R+R). However, because I had branched some of the files that used the namespace from another location is Source Control, they had the readonly attribute set on them. Consequently, I received a dialog which contained the fo...

Remove unused Usings across entire assembly

I am wondering if maybe ReSharper is able to run through every class and remove unused usings? I looked but I don't see an option like this in R# 4.5. Has anyone seen this in Resharper outside of just being able to remove usings in a single class? ...

Is it possible to move a property to another class with ReSharper?

Hi, I have a couple of properties and I want to collect them under a class to make my code more clean. Can I do this quickly with ReSharper? thanks ...

Resharper and Test categories

In TestDriven.Net I can set the following from the TestDriven.Net Options Pane Run tests in all categories Exclude tests in categories Include tests in categories and they will be set once where I can add a comma seperated list. See http://weblogs.asp.net/nunitaddin/archive/2008/12/03/testdriven-net-options-pane.aspx Can th...

Possible NullreferenceException

Resharper is showing a "Possible System.NullReferenceException" warning. I however can't see how I can get one. public class PlaceController : PlanningControllerBase { [Authorize] public ActionResult StartStop(int id) { if (Request != null && Request.Cookies != null && Request.Cookies["place"] != null) { ...

Run Visual Studio Unit Tests vs Run ReSharper Unit Tests, differences?

So I have been running into all kinds of interesting problems in VisualStudio 2008 when running Unit Tests. Such as, when running Visual Studio Unit Tests some tests are failing together but passing individually. This is happening because some class level variables in that test class is being reused in the Unit Tests. Now normally I w...

Why does resharper suggests using readonly in fields that are not changed?

to clearify the question, I'd like to add that I'm not asking why I should choose readonly over const or what are the benefits of readonly over const. I'm asking why to make a field readonly just because it's not changed (at the moment). for example: if I'd write the following class: public class MyClass { public int _i = 5; ...

Resharper - convince management

Possible Duplicate: Business Case for Resharper Hi Guys! I've just recently graduated and I'm working for my first company. During college, one of my professors had every computer loaded with Resharper and I loved it! I bought myself a personal license for it and have been using it ever since. But at my new job, only a sel...

What's the point of the red underline highlighting in ReSharper 5 for ASP.Net MVC?

I recently upgraded to using ReSharper 5 (currently in beta). I noticed that in ASP.Net MVC projects, ReSharper underlines in red all of the return statements inside a controller: I personally find this pretty annoying because it looks like an error. Clicking on the underlined text doesn't offer any help (ie, a lightbulb). I don't see...

How do I output coloured text from by unit tests in the Unit Test Session window in Visual Studio?

How do I output coloured text from by unit tests in the Unit Test Session window in Visual Studio. I am using Resharper VS addin which I think produces the Unit Test Window. I am using this with nunit and wish to use c# Console.Write to generate coloured text to this window. ...

Resharper Question

I just started using VS2008 and Resharper. I have a line: Microsoft.Office.Server.Diagnostics.PortalLog.LogString("*** BOO Feature activating ***"); VS shows "Office" as red b/c it cannot resolve symbol "Office". Can I make Resharper just add the reference automatically, or do I need to manually surf to the reference and add it? ...

Resharper Unit Test Runner executes unit tests sequentially or in parallel?

I would like to know if Resharper Unit Test runner runs unit tests sequentially or in parallell (each on its own thread). I am using MBUnit test framework. Thanks. ...

Resharper Local Variable is never used

Okay, I have a problem with Resharper that is driving me nuts. Let's say I create a method such as private int returnAValue(string something) { int dmid; } As I'm typing the method Resharper take the variable dmid and declares that it is a 'Local Variable that is never used'. As a result it changes the coloring o...

Alt-Insert on a macbook pro keyboard over an RDC connection

How do you send alt-insert (resharper 'generate' keyboard shortcut) over an RDC connection from a macbook pro keyboard? I'm using CoRD as my RDC client if that matters. I've seen fn+m and fn+enter online as suggestions for the insert key, but neither seems to work for me. ...