Visual studio wrong contextual error message - visual-studio-2017

I am using vs2017 latest build. Sometimes when I changed my code in debug mode, vs shows a red squiggly underline, without any reason. I should close and reopen the vs to remove the wrong errors, but now these errors still exist.
Sorry for my bad English. The picture explains my mean:
How can I refresh / reset the editor to clear the wrong errors?
Thanks

You don't refresh or reset the IDE. You build your project and if there are any errors in your code, including at the underlined spot, they show up in the "Error List" window. Then you work them out and build again. Repeat this procedure until there are no errors in the "Error List". During this procedure, any false positives - e.g. red underline - should be gone. Even if they exist, but the error list is empty, your program is doing fine.
If you don't see the "Error List", you display it on the "View -> Error List" or through the shortcut "Ctrl + \,E".

Related

How do I fix a 'cannot open source file' error on MS Visual Studio 2022

Forgive me if I leave out important information, I'm a brand new programmer, and this is my first time using Stack Overflow.
I just downloaded MS Visual Studio, and was testing it by making a basic Console App that outputs "Hello world", but when I tried to run the program, it gave me a message that said "There were build errors. Would you like to continue and run the last successful build?" Then, when I pressed yes I got 478 errors, nearly all of which were "E1696 cannot open source file "filename"", or, "E0282 global source has no "filename"." Is there anyone who has encountered a similar problem, and if so, do you know what is causing it / how to fix it?

VSCode does not show errors in C/C++ before saving

VSCode won't show me error in C++ unless I save the file or do Command Pallete -> C/C++: Run Code Analysis on Active File.
It works properly in JS and Python, so I am 100% sure that it is a language-specific problem.
For example in Python/JS
Shows me error immediately
in C/C++
Error does not show up
Error shows up only after I save/run code analysis
I turned error squiggles on and checked IntelliSense settings more than 100 times.

Why doesn't the c++ file run in visual studio

So I tried making a basic game on the console using screen buffers, I was able to create it and make a square move in the canvas, but for my next project I looked up a website with the ASCII characters and pasted a couple into a comment at the end of the c++ file, when I ran the file visual studio prompted:
I clicked yes and it didn't run anymore.
Also I recently have installed an extension for visual studio (before it didn't run, the extension works fine but I don't know if the extension may have caused this as I didn't tried running it with the extension downloaded and applied), when I open visual studio and open a file it says:
The last record in the ActivityLog xml file, has a type of error and it's description is:
Microsoft.VisualStudio.Composition.CompositionFailedException: Expected 1 export(s) with contract name "Microsoft.VisualStudio.CppSvc.Internal.CodeAnalysis.ICodeAnalysisService" but found 0 after applying applicable constraints.
at Microsoft.VisualStudio.Composition.ExportProvider.GetExports(ImportDefinition importDefinition)
at Microsoft.VisualStudio.Composition.ExportProvider.GetExports[T,TMetadataView](String contractName, ImportCardinality cardinality)
at
Microsoft.VisualStudio.Composition.ExportProvider.GetExport[T,TMetadataView](String contractName)
at
Microsoft.VisualStudio.Composition.ExportProvider.GetExport[T](String contractName)
at
Microsoft.VisualStudio.Composition.ExportProvider.GetExportT
at
Microsoft.VisualStudio.Composition.ExportProvider.GetExportedValueT
at Microsoft.VisualStudio.ComponentModelHost.ComponentModel.GetServiceT
at Microsoft.VisualStudio.VC.ManagedInterop.<>c.<Initialize>b__52_15()
at
System.Lazy`1.CreateValue()
at
System.Lazy`1.LazyInitValue()
at
System.Lazy`1.get_Value()
at
Microsoft.VisualStudio.VC.CodeAnalysis.ResultTaggerProvider.CreateTagger[T](ITextBuffer buffer)
at
Microsoft.VisualStudio.Text.Tagging.Implementation.TagAggregator`1.GatherTaggers(ITextBuffer textBuffer)
--- End of stack trace from previous location where exception was thrown ---
at
Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
I have Visual Studio 2017
So why does running the file (with the local windows debugger button) say that there were build errors? And how can I fix it?
When it prompts the build error, and I click no it usually shows the errors but in this case it doesn't, yes will just run the last "successful" build (although I haven't changed the file since I have finished it before this error message started popping up)
Also there is no error in my code as I was able to run it before the build error kept appearing and I haven't touched the file since(only now to show the problems are)
Thanks for your time! if anything was unclear because of my English, comment and I'll try to clarify it
I fixed the error by deleting ComponentModelChache folder located at:
C:\Users\%userName%\AppData\Local\Microsoft\VisualStudio\15.0
15.0 is the version of your visual studio so it varies depending on the version you're using, %userName% is a replacement for the user you're logged in as

How / Where can I see all TSLint errors for current project in WebStorm?

May be I am missing something but I have not found a dedicated place in WebStorm where I can see (and navigate) all errors reported by TSLint.
In the best case I can find the errors while opening a file and pressing F2 (to go to Next Highlighted Error) which not always working as well.
PS. There is a dedicated TypeScript Pane/l in WebStorm but it doesn't show any TSLint errors, neither these reported in Event Log Pane/l.
Select npm tab from the bottom left side.
Run linting script (you must have it in package.json).
See screenshot below for example:
List of tslint errors/warnings

Error accessing program database in Visual Studio C++

I accidentally allowed an infinite loop, the computer froze, I force-restarted it. Now when I press F5 to build my C++ project, I get the following error:
Error C1301 error accessing program database C:\path\x64\Release\projectName.ipdb, invalid format, please delete and rebuild
And the said file does not even exist. I tried deleting everything in the Release folder, no luck.
How can I solve this?
Thanks in advance.
I was also faced similar type of error which says :-
"C1300 Error accessing program database... LNK1257 code generation failed"
Resolved it in the following way:
Project->Properties->Configuration Properties->General->Whole Program Optimization
set it to
"No Whole Program Optimization"
from "Use Link time Code Generation"