Replies: 1 comment 5 replies
-
My understanding is that if you can't reference the attribute through a reference from another assembly, you can create your own copy of the attribute and it should work as the attributes are found/resolved by name, not the identity of where the type is defined. Example copy so syntax highlighting works for TFMs that don't have the types defined in the framework itself. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've created a library that supports the same set of routes as
AspNetCore
. I would like for my library to take advantage of[StringSyntax('Route")]
syntax highlighting in Visual Studio, without referencing wholeAspNetCore
framewrok.If I reference
AspNetCore.App
framework in my project (viaFrameworkReference
), everything works fine and routes are highlighted correctly.If I do not reference
AspNetCore.App
framework,[StringSyntax("Route")]
attribute does not work (strings are not syntax-higlighted).I've read some mentions that this code is placed in
Microsoft.CodeAnalysis.ExternalAccess.AspNetCore
, but I cannot find nuget with this dll that I could reference as an Analyzer. Is there something I can do to make it work?Beta Was this translation helpful? Give feedback.
All reactions