Visual studio 2017: Prevent css errors to be treated like "errors" - visual-studio

I'm working with Visual studio 2017 with asp.net core (2.1). Some of my css files contains some problem.
Those problems are preventing me to run the server side.
How to prevent the VS treat those warnings as errors?
Thanks!

Go to Tools > Options. Then under Text Editor > CSS > Advanced, you can set "Show errors as warnings" to true. You can also choose to turn off various bits of validation. There may also be a CssLint item there (can't remember if that's from one of my extensions or not). If so, you can choose to turn that off, if you like.
That said, CSS errors don't effect builds. They just show as errors to grab your attention, but you can easily publish with CSS errors. Not sure what exact problem you're having there.

Related

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.

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.

Is there a visual studio automatic save configuration setting?

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?
For VS 2019, the Auto Save File extension seems to work as expected.
It saves individual files on lost focus, can save all files when VS loses focus and can also save all after an inactivity delay.
In VS 2015, I used to use NoMorePanicSave2015.
It does an equivalent of Ctrl+Shift+S when Visual Studio loses focus, which saves all your files, including solution and projects.
Another plugin: CBAutoSave
This extension can automatically save modified documents, projects, and the solution whenever Visual Studio loses focus.
Saving of modified documents is on by default, while automatically saving projects and the solution is not. All options are configurable through the Visual Studio options dialog.
In VS2017/19 Community there is Auto-Recover option under tools->options->autorecover. It will not autosave unless there is a crash, so it may be a good compromise.
In VS2019 its under tools->Options->Environment-AutoRecover.
how-to-auto-save-work-on-visual-studio
Visual Studio 2008 will probably be the same:
http://www.howtogeek.com/howto/programming/configure-autosave-autorecovery-of-crashed-projects-in-visual-studio-2005/
However, it's not "no saving" but you can set it down to 1 minute.
Visual Studio 17.2 can now automatically save code documents whenever the application loses focus. This feature can be accessed via Tools > Options > Environment > Document.
There is an autosave, but I must admit that it doesn't seem to always work for me - notably I suspect that it only saves files, but not projects/solutions, or the .user and .suo files. I don't have any links to prove this mind you.
Visual Studio 2022 (Enterprise) has auto save option. But you have to enable it.
Navigate from Tools > Options > Environment > Preview Features and Enable the autosave.
here is a screenshot

Visual Studio Editor does not underline errors anymore

My Visual Studio (2008) Editor has stopped to underline Errors (this nifty wavy red lines). I can't really tell when, but it can be related to the installation of .Net Framework 3.5 SP 1 or the MVC Beta (which I guess is unlikely). Furthermore have I installed and uninstalled both CodeRush and Resharper for evaluation purposes (decided not to keep either one of them).
Does anyone know the problem and how to restore this functionality again?
Have you checked Tools→Options...→Text Editor→C#→Advanced→Underline errors in the editor?
I usually like to reset my settings after messing around with plugins, as they tend to mess with settings: Tools→Import and Export Settings...→Reset all settings.
About possible causes.
For VS 2012 and 2013 if you have more than one instance of Visual Studio on different machines binded to one "live" account and have installed ReSharper on one of them, it disables the native IntelliSense and error underlines (to replace by it's own rules) that will be synchronised through your account to another machine without ReSharper.
Found it in Visual Studio 2019 as: Tools > Options > Text Editor > General > Show error squiggles
This is generally called Disable Squiggly or Wavy lines in Visual Studio.
How you will do in Visual studio 2013?
TOOLS -> Options... -> Text Editor -> C/C++ -> Advanced -> Disable Squiggles: True/False (Under IntelliSense) -> Press OK
I know its an old question, and with various solutions, but I have fixed it in different way. I'm working with Unity3D on my C# code using VS2017, when suddenly VS decides to stop underlining error while im typing. However, if I close the file tab and reopen, it suddenly undelines the error.
For example:
class A {
public int x;
s;
}
should obvsiouly give an error for that lonely 's' symbol. But, VS doesn't underline it until I close and reopen this file tab.
Solution:
Copied the entire Unity Project folder (which is like a regular VS Solution folder basically) and worked with the new folder, which issue was gone there.
For visual studio 2017 act according to HeeJae's comments in:
https://developercommunity.visualstudio.com/content/problem/113112/design-time-error-checking-isnt-working.html
i.e:
Hi. you are probably hitting a known issue. can you try this?
1.Update to latest release If that doesn’t solve it
2.Go to Tools\Options\Projects and Solutions\General and uncheck “Allow parallel project initialization”.
3.Close VS.
4.Delete the “.vs” directory beside their solution file.
5.Reopen VS.
..
thank you
You can re-enable the "Allow parallel project initialization" option after the issue was solved.
I tried to upgrade VS, reset VS settings, clear VS cache and everything people do conventionally but none of them solved this issue! At the end the mentioned solution worked for me magically.
Good luck
Unloading and loading same project again from the solution does the trick. Just right click on the project and click "Unload Project". Once unloaded, again right click the same project and click "Reload Project". Error highlighting will return.
I had the same issue with 2017. There was a 'disable intelisense' option, make sure that is set to false.
For everyone wondering in 2021..
search for "C_Cpp.errorSquiggles" in the settings.
Make sure to have it active for the user, as well as the workspace.
No need to restart Visual Studio.
For me (VS 2019) , after trying the other answers also, setting the scope of analysis from "Current document" to Open document" brought back the missing error markers
Just go to settings and search for errors and Image in Error Squiggles. You can see the Error squiggles (Modified: Workspace - Right now you can't see it because I modified it). Just click on modified and you will see the disabled option. If by mistake you disabled it, just enable it and you can see the red line errors again in your code.
In latest edition, check for .vscode folder in same project folder. There will be a setting.json file in that. Delete the key value pair of "C_Cpp.errorSquiggles": "Disabled". Restart the vs code.

Resources