Open huettenhain opened 7 years ago
I just opened the same solution on a Windows 10 computer with Visual Studio 2015 and Visual Rust installed - there is no error message and the syntax highlighting works. The problem seems to be with VS2013 or my OS.
reformatted for readability:
System.ComponentModel.Composition.CompositionException: The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information.
1) Cannot set the value of 'VisualRust.Text.RustClassifierProvider.lexer' because the member is not writable. If the member is a property, it must have an accessible setter; otherwise, if it is a field, it must not be read-only.
Resulting in: Cannot activate part 'VisualRust.Text.RustClassifierProvider'.
Element: VisualRust.Text.RustClassifierProvider --> VisualRust.Text.RustClassifierProvider
Resulting in: Cannot get export 'VisualRust.Text.RustClassifierProvider (ContractName="Microsoft.VisualStudio.Text.Tagging.ITaggerProvider")' from part 'VisualRust.Text.RustClassifierProvider'.
Element: VisualRust.Text.RustClassifierProvider (ContractName="Microsoft.VisualStudio.Text.Tagging.ITaggerProvider") --> VisualRust.Text.RustClassifierProvider
at System.ComponentModel.Composition.Hosting.CompositionServices.GetExportedValueFromComposedPart(ImportEngine engine, ComposablePart part, ExportDefinition definition)
at System.ComponentModel.Composition.Hosting.CatalogExportProvider.GetExportedValue(CatalogPart part, ExportDefinition export, Boolean isSharedPart)
at System.ComponentModel.Composition.Hosting.CatalogExportProvider.CatalogExport.GetExportedValueCore()
at System.ComponentModel.Composition.Primitives.Export.get_Value()
at System.ComponentModel.Composition.ExportServices.GetCastedExportedValue[T](Export export)
at System.ComponentModel.Composition.ExportServices.<>c__DisplayClass4`2.<CreateStronglyTypedLazyOfTM>b__1()
at System.Lazy`1.CreateValue()
at System.Lazy`1.LazyInitValue()
at System.Lazy`1.get_Value()
at Microsoft.VisualStudio.Text.Tagging.Implementation.TagAggregator`1.GatherTaggers(ITextBuffer textBuffer)
It's complaining about this:
[Import]
readonly IRustLexer lexer; // <---
[ImportingConstructor]
public RustClassifierProvider(IRustLexer lexer)
{
this.lexer = lexer;
}
I don't know enough about VS extension to be certain, but I think we don't need to both [Import] and init this via [ImportingConstructor].
tl;dr: I just need to remove either [Import]
or readonly
and the ctor.
seems unrelated.
I have installed the Plugin, I run Visual Studio Community 2013 on Windows 2008 Server R2. Usually, differences to Windows 7 are negligible. When creating a new "Rust Application" project, I receive the following error message:
where I have anonymized the path to my ActivityLog.xml. The file contains two error messages towards the end:
The source file in this project then has no syntax highlighting. Building and running executables works fine.
Observation: When I reload the project, or close the solution and re-open it without restarting Visual Studio, syntax highlighting works and no error message is displayed. However, the error re-occurs every time I open Visual Studio for the first time and then load the rust application project.