How can I find all unsed using statements with ReSharper? - visual-studio

I want to find all unused using statements in my Xamarin C# project using Visual Studio and ReSharper.
How can I do this?

You can see the unused using statements as warnings in ReSharper Errors/Warnings in Solution window.
You can open it by,
Navigating to ReSharper | Windows | Solution Errors or,
By double clicking on the Errors/Warnings link at the bottom right corner of Visual Studio
In the appearing window, click on ⚠️ icon to show warnings. If there are unused using statements there will be warnings listed. Expand the warnings to find using statement related warnings.
Double clicking on the warning will take you to the relevant file. The unused using statement can be found in gray colour.
Note: Enable Solution Wide Analysis and Reanalyze All to make sure you want miss anything.

Related

No option to suppress StyleCop warnings in context menu

I have just installed StyleCop v4.7.36.0 and am using Visual Studio 2010.
When I run StyleCop on the solution or individual project the warnings are being correctly reported in the Error List window.
When I right click, however there is no option to suppress the warning message(s).
Is there any way to fix this? I really don't want to have to resort to manually editing the GlobalSuppressions.cs file.
Right click on your project inside visual studio project explorer. And then to StyleCop settings. You can disable any warning you want from the window that is shown.
You can find the specific warning from the code as it appears in your picture. So for example to disable the first warning show, you'd go to warning 1633 in the StyleCop settings window and just uncheck what you want.

CSS style errors in Visual Studio while compiling

Whenever I use CSS3 style commands (like Box-shadow, Box-Sizing, background gradient,etc ) in my Visual Studio 2010 projects and compiles it, VS shows one or more errors regarding CSS3 styles. How can I overcome this behavior of Visual Studio?
You can turn off CSS validation errors in Visual Studio from Tools menu. Select Tools > Options and perform the action shown in the following image.
Up the top there is drop down text box (next to comments in toolbar). Open that and see if you have HTML5/CSS3 in there. If not, you have to download it from MSDN.
I have a better answer for you than the currently accepted answer. It's actually just a small change to said answer and here it is. Just check the "as warnings" box. So it doesn't show up as an error (which is good because it ain't one), but it does show up in your pleasantly-ignorable warnings list still.

VS 2010 C++ IntelliSense

Is it possible to add exceptions to IntelliSense to prevent complaints about statements it is unable to understand, for example BOOST_SCOPE_EXIT?
You can turn off IntelliSense by right clicking on the error tab and removing the check box beside intellisense.

What intellisense dropdown is this, and how do I turn it off?

I'm having some problems with Visual Studio and Intellisense - whenever I click Ctrl+Space to get the regular intellisense dropdown, I get the one shown in the picture instead.
Which setting should I change to prevent this behavior?
How do I get the regular intellisense? http://img121.imageshack.us/img121/8737/vsdropdown.png
This happens in all sorts of files, not just xml...
This problem has appeared since I installed some extensions - I believe this is related either to the Visual Studio Pro Power Tools extension or R#, but I'd rather solve it without uninstalling either of them.
Those look like live templates from ReSharper. You might be able to turn them off by going to ReSharper -> Live Templates -> Predefined Templates and unchecking the items you do not want.
From your screen shot, the a template is under the XML node, the ctx and nguid are under the <no language> node.

Visual Studio not displaying compile time errors in editor

For example, when I write:
string x = "turtle";
x.Go();
There is no red squiggly line detecting the absence of the Go() method on String.
Only when I compile does the error get detected.
I've just upgraded to Windows 7, I have Visual Studio 2008.
In my old environment the errors were detected before the actual compile.
Is there a setting that I am missing?
EDIT: "Tools -> Options -> Text Editor -> C# -> Underline errors in the editor" is checked.
I dont have the "Live Semantic" option. Maybe I need to go to SP1?
You need to turn on the underline errors in the editor and show live semantic errors options in Visual Studio.
These options can be found here:
Tools > Options > Text Editor > C# > Advanced > Editor Help
Edit: You will need to install SP1 for this functionality to work.
Select Tool -> Options, then Text Editor. Under the language you are using (ie C#), go to the Advanced and make sure the Underline errors in the editor and Show live semantic errors are checked
Stop the project.
Open Folder Project.
Delete .vs folder (he is a hidden folder)
Then restart Visual Studio
EDIT:
This approach has been around since the 2012 version of Visual Studio. This folder consists of keeping all breakpoint information and other settings saved. It is not known why, the configurations arrive at a time when the errors of compilations no longer appear. Deleting the .vs folder will "reset" your breakpoints forcing you to do them again if you need to.
For visual studio 2015 and higher:
Go to: Tools > Options > Text Editor > C# > Advanced > Editor Help
Then select: Enable Full solution analysis
I had the same issue and had SP1 installed and had Underline errors in the editor and Show live semantic errors checked in VS2008's options.
My solution was to download Microsoft Visual Studio 2008 Service Pack 1 (Installer) and re-install the package. It wasn't classified as a 'repair' or a 're-install' despite the fact it was already installed, but it worked.
Restarting VS solved my problem once.
my solution; I know it won't help like 80% of the viewers, but for the sake of who it will:
i have had a lot of noise in the IOS part of the solution, a VS bug that showed a lot of errors that weren't supposed to appear, so I just deleted the IOS part because I didn't really needed it as I didn't even had a Mac server to test it on... Something happened after that and the squiggly line returned! Seriously, VS team, fix your bugs...
JavaScript Type Checking
Sometimes type checking your JavaScript code can help you spot mistakes you might have not caught otherwise. You can run the TypeScript type checker against your existing JavaScript code by simply adding a // #ts-check comment to the top of your file.
// #ts-nocheck
let easy = true;
easy = 42;
Tip: You can also enable the checks workspace or application wide by adding "javascript.implicitProjectConfig.checkJs": true to your workspace or user settings and explicitly ignoring files or lines using // #ts-nocheck and // #ts-ignore. Check out the docs on JavaScript in VS Code to learn more.
In my case the problem was that I created a file with .s extension instead of .cs an then changed the extension to .cs once it was created.
I deleted it and created again correctly and now VS is underlining the errors in this file.

Resources