resharper

Resharper - turn off solution wide analysis

倾然丶 夕夏残阳落幕 提交于 2019-12-20 11:11:30
问题 I want to turn it off completely and not get any solution-wide hints. I only see where I can pause I but can't find an answer for turning it off. 回答1: In Resharper 5.1, turn it off by unchecking the 'Analyze errors in whole solution' under ReSharper->Options->Code Inspection->Settings You can also turn it off by right clicking on the green analysis circle (bottom right of Visual Studio) and select 'Analyse Errors in Solution'. 回答2: In the tool window for Solution-wide analysis: the ⑪ button

Resharper - turn off solution wide analysis

梦想与她 提交于 2019-12-20 11:11:26
问题 I want to turn it off completely and not get any solution-wide hints. I only see where I can pause I but can't find an answer for turning it off. 回答1: In Resharper 5.1, turn it off by unchecking the 'Analyze errors in whole solution' under ReSharper->Options->Code Inspection->Settings You can also turn it off by right clicking on the green analysis circle (bottom right of Visual Studio) and select 'Analyse Errors in Solution'. 回答2: In the tool window for Solution-wide analysis: the ⑪ button

Why do I get an error 'Cannot resolve symbol <symbolname>' in ReSharper?

喜欢而已 提交于 2019-12-20 09:59:51
问题 Using VS2008 and R# 5 I'm running into an odd situation, where on an aspx page I keep getting Cannot resolve symbol 'symbolname' But the code compiles and runs fine. While having a fix for this would be great, I'm just trying to figure out if I'm losing my mind. The CodeFile directive and Inherits directives are fine. If I compile the app or just let devenv sit for a bit it'll go away, but as soon as I save the aspx [via ctrl+s] R# suddenly has trouble with the Inherits attribute and flips

Using WPF components in NUnit tests - how to use STA?

非 Y 不嫁゛ 提交于 2019-12-20 09:47:38
问题 I need to use some WPF components in an NUnit unit test. I run the test through ReSharper, and it fails with the following error when using the WPF object: System.InvalidOperationException: The calling thread must be STA, because many UI components require this. I've read about this problem, and it sounds like the thread needs to be STA, but I haven't figured out how to do this yet. What triggers the problem is the following code: [Test] public void MyTest() { var textBox = new TextBox();

Using WPF components in NUnit tests - how to use STA?

泪湿孤枕 提交于 2019-12-20 09:47:11
问题 I need to use some WPF components in an NUnit unit test. I run the test through ReSharper, and it fails with the following error when using the WPF object: System.InvalidOperationException: The calling thread must be STA, because many UI components require this. I've read about this problem, and it sounds like the thread needs to be STA, but I haven't figured out how to do this yet. What triggers the problem is the following code: [Test] public void MyTest() { var textBox = new TextBox();

Get correct indentation in Resharper for object and array initializers

馋奶兔 提交于 2019-12-20 09:09:56
问题 Right now resharper formats our code like this: private readonly List<Folder> folders = new List<Folder> { new Folder() }; but I want it to look like this: private readonly List<Folder> folders = new List<Folder> { new Folder() }; I've been messing with the options a lot, but can't seem to get them right. Can you help? 回答1: I had the same issue with anonymous delegates. The fix for anonymous delegate formatting is here: I did finally find the way to fix this. The options for formatting

Resharper compile time autoformat incorrectly changes code

牧云@^-^@ 提交于 2019-12-20 05:50:41
问题 Resharper changes below code string strTest = "Test"; string strTest2 = "Test2"; to this string strTest = "Test";string strTest2 = "Test2"; if cursor is at the end of the first line when I start project. It makes all breakpoints obsolete ("The breakpoint will not currently be hit. The source code is different from the original version.") And sometimes it mixes comment line with code line and completely breaks execution. For instance: //Comment line string strTest = "Test"; changes to /

How can I safely loop until there is nothing more to do without using a “placeholder” while conditon?

岁酱吖の 提交于 2019-12-20 04:07:20
问题 In order to call my Web API method until no more data is returned (I'm fetching it in batches, to keep each result set small, due to the 98-lb-weakling persona of the client (Windows CE handheld device)), I'm using this code: while (moreRecordsExist) { redemptionsList.redemptions.Clear(); string uri = String.Format("http://platypus:28642/api/Redemptions/{0}/{1}", lastIdFetched, RECORDS_TO_FETCH); var webRequest = (HttpWebRequest)WebRequest.Create(uri); webRequest.Method = "GET"; using (var

DotCover shows only unit test source code not production code

社会主义新天地 提交于 2019-12-20 02:39:09
问题 I'm starting to use dotCover. I have a set of Debug compiled dlls + their pdbs. Then I've created a test project and executed resharper on it to see the coverage. What I'm getting is the coverage only of the unit test project instead of the whole coverage: I expected to find on the coverage tab the dlls referenced from my unit tests and their coverage. Am i right? Maybe I'm missing something or am I doing something wrong? 回答1: You can try to uncheck the "Match coverage results with current

Is LINQifying my code worth accessing a foreach variable in a closure?

牧云@^-^@ 提交于 2019-12-20 02:11:53
问题 Reminiscent of the title of a bootleg live Rolling Stones recording of yesteryear, Resharper is sharper than I'll ever be; as I had it inspect my code, it told me this regarding closures: 1) "Loop: foreach (var item in PlatypiIds) { var query = db.Table<Locations>().Where(l => l.PlatypusId == item). Where(l=> l.SentTimeUTC >= EarliestToShow). Where(l=> l.SentTimeUTC <= LatestToShow). OrderBy(l => l.SentTimeUTC); if (query != null) { foreach (var q in query) { listLocs.Add(q); } } } ...can be