VS Arduino
Visual Micro >> Visual Studio 2017, 2019, 2022 >> Exception when starting VM
https://www.visualmicro.com/forums/YaBB.pl?num=1588591826

Message started by SaturdayScience on May 4th, 2020 at 11:30am

Title: Exception when starting VM
Post by SaturdayScience on May 4th, 2020 at 11:30am
I am very new to VM and of limited experience with MSVS.
When I open an existing project the exception error happens [see image file] I have also attached the error file. The error is line 819 at the bottom of the file.

Whatever the error is truly about is beyond me; and it does not interfere with code compilation.
Question zero: is this error related specifically to VM?
Question one: is there any reason for me to simply ignore it and continue? Or is there something I should modify?

Every day is a learning opportunity. Thank you to the knowledgeable for sharing with a beginner.
:)

Title: Re: Exception when starting VM
Post by Visual Micro on May 4th, 2020 at 11:40am
Please attach the image

Title: Re: Exception when starting VM
Post by SaturdayScience on May 4th, 2020 at 12:42pm
Apologies - I thought the image was in the zip.
MSVS_error.png ( 84 KB | 34 Downloads )

Title: Re: Exception when starting VM
Post by SaturdayScience on May 4th, 2020 at 12:44pm
And the xml file
https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=error_002.zip ( 82 KB | 11 Downloads )

Title: Re: Exception when starting VM
Post by Visual Micro on May 4th, 2020 at 2:06pm
When you open an arduino project is is actually just a standard visual studio c++ project. Visual Micro does also not load any code that runs in the code editor. This error seems to be related to visual studio or come other code editing extension.

I suggest ensuring vs up to date (help>check for updates> or running the repair in control panel > add or remove programs > vs

This is the error from your xml file.


Code (]
  <entry>
    <record>620</record>
    <time>2020/05/04 10:53:33.765</time>
    <type>Error</type>
    <source>Editor or Editor Extension</source>
    <description>Microsoft.VisualStudio.Composition.CompositionFailedException: Expected 1 export(s) with contract name &quot;Microsoft.VisualStudio.CppSvc.Internal.CodeAnalysis.ICodeAnalysisService&quot; but found 0 after applying applicable constraints.&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.ExportProvider.GetExports(ImportDefinition importDefinition)&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.ExportProvider.GetExports[T,TMetadataView):

(String contractName, ImportCardinality cardinality)&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.ExportProvider.GetExport[T,TMetadataView](String contractName)&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.ExportProvider.GetExport[T](String contractName)&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.ExportProvider.GetExport[T]()&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.ExportProvider.GetExportedValue[T]()&#x000D;&#x000A;   at Microsoft.VisualStudio.ComponentModelHost.ComponentModel.GetService[T]()&#x000D;&#x000A;   at Microsoft.VisualStudio.VC.ManagedInterop.&lt;&gt;c.&lt;Initialize&gt;b__52_15()&#x000D;&#x000A;   at System.Lazy`1.CreateValue()&#x000D;&#x000A;   at System.Lazy`1.LazyInitValue()&#x000D;&#x000A;   at System.Lazy`1.get_Value()&#x000D;&#x000A;   at Microsoft.VisualStudio.VC.CodeAnalysis.ResultTaggerProvider.CreateTagger[T](ITextBuffer buffer)&#x000D;&#x000A;   at Microsoft.VisualStudio.Text.Tagging.Implementation.TagAggregator`1.GatherTaggers(ITextBuffer textBuffer)&#x000D;&#x000A;--- End of stack trace from previous location where exception was thrown ---&#x000D;&#x000A;   at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)</description>
  </entry>

Title: Re: Exception when starting VM
Post by SaturdayScience on May 4th, 2020 at 4:00pm
If I open a VS C# solution then I do not get an error. If I open a VM solution then the error pops up like clockwork. That's why I felt there was a connection.

The Arduino project was started as a clean project aka VM empty Arduino Project. It started with the .ino file and I grew the project from the setup() and loop() functions.

It isn't a problem as all code compiles and executes. I was simply asking the original questions.

Thanks for your time.

Title: Re: Exception when starting VM
Post by Visual Micro on May 4th, 2020 at 6:20pm
Thanks for the info. Actually a c# project might not show the issue. Try creating an new empty c++ project such as a widows console app. (not an arduino project)

Regardless of an error appearing it does sound like an extension or vs needs a repair.

VS Arduino » Powered by YaBB 2.6.12!
YaBB Forum Software © 2000-2024. All Rights Reserved.