resharper

Visual Studio recent “hungry” or “greedy” backspace behavior update?

限于喜欢 提交于 2020-01-03 04:33:07
问题 As of recent, Visual Studio 2017 (and 2019 which I just started using) seems to have changed the behavior of the backspace button, specifically, the cursor is at a place where only white space (lets say tabs) is to the left of the cursor. I used to press backspace and delete one tab. Now, all the white space is removed and my line of code is placed on the end of the line above. Seems like a good idea and probably is to most people, but the result for me is that I mash the backspace key out of

VS2013 IntelliSense overlapping ReSharper's one

筅森魡賤 提交于 2020-01-03 04:19:38
问题 After installing ReSharper I've noticed a problem with the IntelliSense; In the image it is clearly visible that the IntelliSense of Visual Studio is displayed over the one of ReSharper (which by the way has the focus, so using the arrow keys will move the highlight section of the completion list below). I've tried to do several things without any result (always with VS restart): Switch from ReSharper IntelliSense to VS (back and forth) Limit ReSharper IntelliSense to some selected languages

.NET Core - Project compiles and run, reSharper shows lots of errors on “FileStream” and “MemoryStream” objects

这一生的挚爱 提交于 2020-01-03 02:19:30
问题 I have a .NET Core project which compiles and runs without errors. However, ReSharper (version 2017.1.2) throws up a number of errors throughout the project, mostly related to stream objects. For example: Cannot convert source type 'System.IO.MemoryStream' to target type 'System.IO.Stream' and when reading a stream Module 'System.Private.CoreLib, Version=4.0.0.0 {snip}' should be referenced I think it's related to the latter error, however as everything runs it's just frustrating that I can't

Resharper multiple property generation

折月煮酒 提交于 2020-01-02 04:24:16
问题 This might be a lazy request, but is there a way to generate multiple class properties at the same time? Currently, I have a large list of undefined properties and I can simply go through the list, one by one, and generate a property - but it would be ideal to highlight them all and generate one for each, example illustration below... You can see here that prop1 , prop2 ...etc have errors since the properties don't yet exist, but you can generate a property with resharper... However, this

VS 2017 mouse navigate backward stopped working with ReSharper

拟墨画扇 提交于 2020-01-02 03:39:07
问题 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. 回答1: Microsoft introduced its own Ctrl+Click feature implementation in the latest build of VS2017, try disabling

can WindowsIdentity.GetCurrent() return null?

孤街浪徒 提交于 2020-01-02 00:56:06
问题 ReSharper warns me about a possible NullReferenceException in WindowsIdentity windowsIdentity = new WindowsIdentity(WindowsIdentity.GetCurrent().Token); I looked in MSDN doc but didn't see any mention of this. Also, it doesn't make sense since if you run an executable, you have to be logged on. Is this just a ReSharper search pattern? 回答1: Using ILSpy, you can look at a de-compiled version of GetCurrent and GetCurrentInternal , which GetCurrent calls. The result is: GetCurrent: public static

ReSharper: Find Usages of an optional parameter

非 Y 不嫁゛ 提交于 2020-01-02 00:52:28
问题 If I have a function with optional parameter, is there an easy way to find all the locations in my code that call that function and pass a value to that parameter? The function has many non-default parameters, so scanning the usual Find Usages results of places that call the function is problematic, as it trims the lines and I can't see if the optional parameter is used. 回答1: With your cursor on the parameter, choose ReSharper | Inspect | Value Origin , or from the keyboard, Inspect This with

Resharper force space after curly bracket and before closing bracket

别说谁变了你拦得住时间么 提交于 2020-01-01 23:35:08
问题 Resharper is giving me this: new MyObject {Prop1 = prop1, Prop2 = prop2} But I want: new MyObject { Prop1 = prop1, Prop2 = prop2 } Currently it's breaking my StyleCop rules. 回答1: I think this is the setting you are looking for. http://screencast.com/t/nEXMHo6Ko Dead link --Edit-- In case of a dead link, The setting is under C# -> Formatting Style -> Spaces -> Within single-line initializer braces. Check the box next to it and you'll be all set. 来源: https://stackoverflow.com/questions/6066437

An expression tree may not contain a reference to a local function

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-01 09:11:50
问题 Error: An expression tree may not contain a reference to a local function public void Initialize() { CloudStorageProperties ImageFileProperties(string fileName) => _cloudStorage.GetBlob(CloudStorageType.Image, fileName).FileProperties; Config = new MapperConfiguration(x => { x.CreateMap<Category, CategoryViewModel>() .ForMember(vm => vm.ImagePath, m => m.MapFrom(src => ImageFileProperties(src.ImageFile.Name).Uri.AbsoluteUri)); }); } I can replace the local function with an anonymous function

An expression tree may not contain a reference to a local function

戏子无情 提交于 2020-01-01 09:11:14
问题 Error: An expression tree may not contain a reference to a local function public void Initialize() { CloudStorageProperties ImageFileProperties(string fileName) => _cloudStorage.GetBlob(CloudStorageType.Image, fileName).FileProperties; Config = new MapperConfiguration(x => { x.CreateMap<Category, CategoryViewModel>() .ForMember(vm => vm.ImagePath, m => m.MapFrom(src => ImageFileProperties(src.ImageFile.Name).Uri.AbsoluteUri)); }); } I can replace the local function with an anonymous function