lolfail
lolfail

Reputation: 124

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: visual studio prompt

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: vs file open

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

Upvotes: 2

Views: 385

Answers (1)

lolfail
lolfail

Reputation: 124

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

Upvotes: 1

Related Questions