How to make ReSharper re-evaluate its assembly reference highlighting

I am creating a Prism Project Template, and the template works great. But after I create a project with the template some of the files look like this: Despite appearances, everything is just fine. If I do a Rebuild All I see that the solution builds with no errors: But the rebuild all does not … Read more

Test method is inconclusive: Test wasn’t run. Error?

I have a test class and below I have posted a sample test from the test class namespace AdminPortal.Tests.Controller_Test.Customer { [TestClass] public class BusinessUnitControllerTests { private IBusinessUnitRepository _mockBusinessUnitRepository; private BusinessUnitController _controller; [TestInitialize] public void TestInitialize() { _mockBusinessUnitRepository = MockRepository.GenerateMock<IBusinessUnitRepository>(); _controller = new BusinessUnitController(_mockBusinessUnitRepository); } [TestCleanup] public void TestCleanup() { _mockBusinessUnitRepository = null; _controller.Dispose(); _controller = … Read more

Why does ReSharper want to use ‘var’ for everything? [duplicate]

This question already has answers here: Difference between “var” and “object” in C# [duplicate] (6 answers) Closed 11 months ago. I’ve just started using ReSharper with Visual Studio (after the many recommendations on SO). To try it out I opened up a recent ASP.NET MVC project. One of the first and most frequent things I’ve … Read more

Keyboard shortcuts are not active in Visual Studio with Resharper installed

I have Visual Studio 2012 + Resharper 7.1.1000.900 + StyleCop 4.7.44 installed. The problem is that no shortcuts are active since Resharper was installed. For example: I can rename via ‘Refactor > Rename’. But shorcut Ctrl+R does nothing. I’ve set Resharper keyboard scheme to ‘Visual Studio’ in ‘Resharper > Options > Environment > Keyboard & … Read more

ReSharper warns: “Static field in generic type”

public class EnumRouteConstraint<T> : IRouteConstraint where T : struct { private static readonly Lazy<HashSet<string>> _enumNames; // <– static EnumRouteConstraint() { if (!typeof(T).IsEnum) { throw new ArgumentException( Resources.Error.EnumRouteConstraint.FormatWith(typeof(T).FullName)); } string[] names = Enum.GetNames(typeof(T)); _enumNames = new Lazy<HashSet<string>>(() => new HashSet<string> ( names.Select(name => name), StringComparer.InvariantCultureIgnoreCase )); } public bool Match(HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary … Read more

Where do I mark a lambda expression async?

I’ve got this code: private async void ContextMenuForGroupRightTapped(object sender, RightTappedRoutedEventArgs args) { CheckBox ckbx = null; if (sender is CheckBox) { ckbx = sender as CheckBox; } if (null == ckbx) { return; } string groupName = ckbx.Content.ToString(); var contextMenu = new PopupMenu(); // Add a command to edit the current Group contextMenu.Commands.Add(new UICommand(“Edit this … Read more

Tests not running in Test Explorer

I am currently working on a solution that has currently 32 Unittests. I have been working with the resharper test runner – which works fine. All tests are running, all tests are showing the right test outcome. However, the tests are not running when using the Visual Studio test explorer. The Test Explorer is showing … Read more