Project contains numerous invalid exports of ILanguageService
sharwell opened this issue · comments
Sam Harwell commented
ILanguageService
needs to be exported using ExportLanguageServiceAttribute
.
Here is one example:
These exports are breaking Visual Studio in 17.10 Preview 3 and newer, where additional validation is applied to ILanguageService
and ILanguageServiceFactory
exports.
Ieuan Walker commented
Josef Pihrt commented
@sharwell Is this how it should be?
[ExportLanguageService(typeof(ILanguageService), LanguageNames.CSharp)]
[ExportMetadata("Language", LanguageNames.CSharp)]
[ExportMetadata("ServiceType", "Roslynator.CodeMetrics.ICodeMetricsService")]
internal class CSharpCodeMetricsService : CodeMetricsService
Sam Harwell commented
@josefpihrt The ExportMetadata
lines can be removed. You just need this:
[ExportLanguageService(typeof(ICodeMetricsService), LanguageNames.CSharp)]
Josef Pihrt commented
@sharwell Thanks!
Josef Pihrt commented
Fix has been released.