Remove dependency on Microsoft.CodeAnalysis.Workspaces
FixerWithFixAllAnalyzer references types in the Workspaces assembly in a couple of places: ``` C# private static string CodeFixProviderMetadataName = typeof(CodeFixProvider).FullName; ``` This creates a runtime dependency on Microsoft.CodeAnalysis.Workspaces.dll which is part of VS but not part of the compilers (csc/vbc/vbcscompiler). The analyzers that derive from this type thus work in VS but fail during build with a `TypeInitializationException`. The fix is to use hard-coded strings for the names of these types. As they are part of the public API, their names won't be changing anytime soon. This does not remove the project-to-project reference to Workspaces. Doing so would have required fixing up a bunch of `<see cref="..." />` elements in the doc comments to use the full name of these types as well, generally making them much uglier. This isn't necessary to fix the runtime issue.
Showing
想要评论请 注册 或 登录