Replies: 1 comment
-
|
It's a shortcoming of ProjectReference. A direct workaround is to publish the analyzer as a (local) NuGet package and use PackageReference, assuming it's changing infrequently. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a base project (user code) with a abstruct type
Xxxthat needs to be implemented by projects that inherit from it, and requires to enforce implementation patterns (such as property name format).Analyzer can do this, but analyzer reference isn't passed down through project reference, I cannot find a way to force the inherte projects to reference the anlayzer.
In other words, projects that reference project
X(includeXxx) should also reference theXAnalyzerproject as analyzer.I have an idea to "finish the jigsaw" for derived classes by generating specific code using an incremental code generator. If the project is missing this necessary analyzer reference, the code with the missing "jigsaw piece" will fail when compile.
Is this possible? Or did I take the wrong path?
In short, the ultimate goal is to enforce that specific derived classes have implementations that fit to a contract when coding, rather than checking at runtime.
Beta Was this translation helpful? Give feedback.
All reactions