resharper

VS 2017 mouse navigate backward stopped working with ReSharper

ぃ、小莉子 提交于 2019-12-05 07:53:03
I like the VS feature to navigate backwards (e.g. after Ctrl+Click) using mouse back button. Unfortunately this feature stopped working. Literally using mouse back button does nothing. I have found out that navigation works again when I disable ReSharper. However, with enabled ReSharper it does not. Does anyone meet the same issues? I am using ReSharper 2017.2.2 and VS 2017 15.4.4. Microsoft introduced its own Ctrl+Click feature implementation in the latest build of VS2017, try disabling it here Tools | Options | TExt Editor | General | Untick "Enable mouse click to perform Go to Definition"

Using MSpec runner in Visual Studio 2010 and .NET 4

送分小仙女□ 提交于 2019-12-05 07:25:50
I'm a big fan of MSpec so naturally I wanted to use is right away with VS2010 as well. I have the MSpec runner defined as an external tool in Visual Studio to be able to have it always visible as a toolbar item. Anyway, whenever I try to use the MSpec runner (mspec.exe) with a .NET 4.0 solution I get the following error: Could not load file or assembly 'file:///C:\Users\[SOMEUSER]\[SOME_FOLDERS]\bin\Debug\[PROJECT].Specs.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded. I can still run my specs with the Resharper

Adding and removing multiple references across projects in Visual Studio

我怕爱的太早我们不能终老 提交于 2019-12-05 07:20:24
I have a huge project with over 50 or 60 csproj files. I need to remove 6 or 7 references exiting references and add 10 or 15 new references across all these projects. Is there a mechansim to bulk add references and remove references? Or if there is a way to say, replace reference X with Y across all projects, that would be very helpful too. Let me add that Nuget is not an option. This one's easy: just write a script that opens up all your .proj files, removes the lines you don't need and add the lines you do. That's the easiest way. I think there are also options for writing plug-ins for VS

Stop VS 2010 from Auto Creating Braces After else keyword

浪尽此生 提交于 2019-12-05 07:07:48
I'm using VS 2010, and I'm getting constantly annoyed when I type "else" and then it auto returns line and adds braces. Something like: else { } I cannot imagine I'm the only one who often puts one-liners after the else and prefers no braces. How do I stop this from happening? I also found this behavior very annoying. My first attempt involved opening the Templates Explorer (ReSharper / Templates Explorer...), selecting C#, then unchecking "else". This did get rid of the braces. Unfortunately, hitting enter after "else" now just added a space! I was having to hit enter twice. Not quite what I

Register generic page base class

夙愿已清 提交于 2019-12-05 05:41:19
I create my own generic page base class: public abstract class ViewPageBase<TModel> : WebViewPage<TModel> { public ParamBuilder<TModel> Param { get { return new ParamBuilder<TModel>(Model); } } } Web.config: <system.web.webPages.razor> <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> <pages pageBaseType="ViewPageBase"> <namespaces> <add namespace="System.Web.Mvc" /> <add namespace="System.Web.Mvc.Ajax" /> <add namespace="System.Web.Mvc.Html" /> <add namespace="System.Web.Routing" /> </namespaces> <

nullable type and a ReSharper warning

寵の児 提交于 2019-12-05 05:20:51
I have the following code: private static LogLevel? _logLevel = null; public static LogLevel LogLevel { get { if (!_logLevel.HasValue) { _logLevel = readLogLevelFromFile(); } return _logLevel.Value; } } private static LogLevel readLogLevelFromFile() { ... } I get a ReSharper warning on the return statement about a possible System.InvalidOperationException and it suggests I check _logLevel to see if it is null first. However, readLogLevelFromFile returns LogLevel , not LogLevel? , so there is no way the return statement could be reached when _logLevel is null . Is this just an oversight by

R#6 - Suggests “Use directory” in razor views. How to disable?

萝らか妹 提交于 2019-12-05 04:42:57
I am using R#6 and when I edit some razor views, R#6 suggests that I "use directory". (Whine :)) I dont want to! How do I turn off this annoyance? I have searched through R#6 options. It is definitely R# since the annoyance goes away when i suspend R#. In the printscreen, R# wants to change /SignUp to ../Signup. It is incorrect because the view is the layout and could be in any directory structure. So i want it to be /Signup Solution: As derigel states. Wait for the warning to show. Hit escape. Then CTRL+Enter. A mini menu appears where you can suppress or change the warning severity. I

Find usages of inherited method only from a specific subclass?

主宰稳场 提交于 2019-12-05 04:35:16
I have a superclass which is inherited by many subclasses. I would like to find all calls to a certain method in this superclass which originate from instances of a specific inheriting class. Is this possible in VS2012 (with Resharper 7.1)? Code example: public class Super { public void foo(Arg a) { ... } } public class Sub1 : Super { ... } public class Sub2 : Super { ... } public class SomeClass { public void Run() { ... var sub1 = new Sub1(); sub1.foo(a); var sub2 = new Sub2(); sub2.foo(b); } } I would like to find only the call sub2.foo(b) not sub1.foo(a) in the example above. You should be

Go to closing Tag in Visual studio (using Resharper)?

做~自己de王妃 提交于 2019-12-05 03:27:43
I'm using the latest Resharper (v 8.1) with visual studio 2010. Is there a keyboard shortcut/feature to "Jump to closing tag" ? For example : if the cursor is on the first tr : I want the cursor to go to the closing tr which is </tr> Is there any shortcut for this ? (p.s. - something like goto matchine brace but for Xml/html tags) From what I've gathered there's no shortcut for this in either reSharper or Visual Studio. A "work around" would be to collapse the tag using Ctrl + M + M, then go to the start or end of the line using Home or End key. When you open it again using Ctrl + M + M will

resharper intellisense problem with extension methods

一曲冷凌霜 提交于 2019-12-05 03:21:47
so, I have a repository defined with a method like this: IQueryable<Customer> Customers{...} and elsewhere an extension method to filter the customers like so: public static IQueryable<Customer> WithID(this IQueryable<Customer> customers, int ID){...} and this woks nicely, letting me use the repository like this: var c = repo.Customers().WithID(5).Single(); but the problem is, ReSharper messes up the Auto-Completion on this big time. When I type var c = repo.Customers().Wi I get nice Intellisense showing me the WithID(...) method, but when I cursor down to it and hit TAB, instead of getting