resharper

Cannot resolve Symbol ObjectStateManager

跟風遠走 提交于 2019-12-05 00:12:35
I have getting an Error of " Cannot Resolve Symbol ObjectStateManager " when trying to call it on my Database context from Entity Framework 4. I can't find anyone else having this issue. I have tried using System.Data and System.Data.Objects . Is there a specific Entity Framework that needs to be made in order to use the ObjectStateManager? Or Am I missing some sort of install package? I am using Database First Entity Framework. Here is the code it is giving my error: (Line 7) [HttpPost] public ActionResult EditProfile(User user) { if (ModelState.IsValid) { db.Users.Attach(user); db

ReSharper: Find Usages of an optional parameter

冷暖自知 提交于 2019-12-05 00:00:20
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. With your cursor on the parameter, choose ReSharper | Inspect | Value Origin , or from the keyboard, Inspect This with Ctrl + Shift + Alt + A , then Value Origin . You will get an Inspection Results window with all the places

How to turn off ReSharper's “Find All Usages”

ε祈祈猫儿з 提交于 2019-12-04 23:47:34
I am giving ReSharper for C# a whirl. I have found that I prefer Visual Studio's simpler "Find All References" over ReSharper's more detailed "Find All Usages". "Find All References" finds everything I need 95+% of the time. Does anyone know of a way to turn off "Find All Usages" and revert back the VS's implementation? Mark Broadhurst Unfortunately not there is no way to turn it off with out turning the whole thing off. Sorry, it takes a bit of getting used. To restore the original VS 'Find All References' command: Go to ReSharper Options > Environment > Keyboard & Menus Clear 'Hide

Can't run MSTest unit tests via Resharper after upgrading to VS 2012 Update 2

只愿长相守 提交于 2019-12-04 22:22:14
All tests are in pending state. I can not run or debug them. I see that others are experienced the same issue: http://youtrack.jetbrains.com/issue/RSRP-339546 Jetbrains are on the case already: We will be releasing an update to ReSharper 7 to fix the issue with the test runner and Visual Studio Update Pack 2. — JetBrains ReSharper (@resharper) April 5, 2013 Jetbrains fix it: http://youtrack.jetbrains.com/issue/RSRP-339987 Seems to work in most case, still not with Windows Phone. Run VS as administrator. I had exactly the same issue with vs2012 and resharper and it works like charm now I'm

Resharper force space after curly bracket and before closing bracket

北城余情 提交于 2019-12-04 22:21:59
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. 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/resharper-force-space-after-curly-bracket-and-before-closing-bracket

Is there a visual studio automatic save configuration setting?

若如初见. 提交于 2019-12-04 22:19:01
I use the java IDE IntelliJ IDEA and one of the features I like is that there's no saving. Everything's always saved and you just use history navigation. I tend to have both editors open and I'm always forgetting to save in VS. I'm running vs 2008 with resharper 4.5 but as far as I can tell this isn't achievable or configurable. Any suggestions? This works great for me in VS 2015. The name of the plugin is NoMorePanicSave2015. It does an equivalent of Ctrl + Shift + S when Visual Studio loses focus, which saves all your files, including solution and projects. Here's the link: https:/

Resharper convert auto-property to full property

若如初见. 提交于 2019-12-04 22:16:36
I found the opposite here , but I need to frequently change from auto-property to full property - would it be possible to automate that (and with a shortcut perhaps): From Auto-Property public string FirstName { get; set; } To Property with Backing Field private string _firstName; public string FirstName { get { return _firstName; } set { _firstName = value; } } Obviously, I would then change the full property further ... Dan Morphis Place your cursor on the property name, then wait a second or two. Press the Resharper hotkey sequence (Alt-Enter) and the second option should be "To property

Code is heuristically unreachable

久未见 提交于 2019-12-04 22:12:32
What does this mean in contrast to "unreachable code detected"? Heuristically unreachable means possibly unreachable code. Unreachable code is certainly unreachable. Here's an example of Resharper giving the cryptic "Heuristically unreachable code" warning: It's an example of: Resharper being way to smart for itself, because if you remove it the compiler will complain about a lack of a return statement Use of a word that is not common lexicon Say you're deleting 2 different kinds of objects in a unit test and you want to use a try/catch for both types. If you delete one, and then check to see

Understanding the warning: binding r-value to l-value reference

左心房为你撑大大i 提交于 2019-12-04 22:02:34
问题 I want to pass a struct by reference so it won't be copied, but Resharper is giving the warning below: struct sometype { }; sometype foo() { sometype x; return x; } void bar() { sometype & a = foo();//Binding r-value to l-value reference is non-standard Microsoft C++ extension sometype && b = foo(); //ok } Questions: What's wrong with sometype & a = foo(); ? isn't the return value from foo() an lvalue and a is also an lvalue? Is sometype && b = foo(); actually rvalue reference? Does it "steal

Why does resharper suggest const, static operations?

谁都会走 提交于 2019-12-04 19:21:55
问题 I was wondering why resharper suggests a method to be static in non static class? Is it for saving the creation of the instance? Is it a matter of performance? also, why does it suggest to 'const' some params? Is it a matter of performance ? I would love to get some explanation 回答1: When compiler encounters a static method it emits call instructions but when it encounters an instance method it emits callvirt instruction. Now the callvirt instruction checks the object whether it is null before