Roslyn analyzers to enforce Industrial Architecture V2 compliance.
- IEC61850NSP001 — No Static Policy
- IEC61850LAY001 — Layer dependency violation (UI must not reference Infrastructure)
- IEC61850SL001 — Service Locator forbidden in UI
- IEC61850IO001 — System.IO forbidden in UI/Application
- IEC61850NET001 — Network APIs forbidden in UI/Application
- IEC61850TIME001 — DateTime.Now/UtcNow/new DateTime forbidden in UI/Application
- IEC61850THR001 — UI blocking calls forbidden (Thread.Sleep, Task.Wait/Result)
- IEC61850EVT001 — Static events forbidden
- IEC61850CFG001 — Configuration access forbidden outside Infrastructure
- IEC61850LOG001 — Logging forbidden in Domain
Use Directory.Build.props to attach the analyzer project to all projects as an analyzer:
<ItemGroup>
<ProjectReference Include="analyzers\IEC61850_IED_Tool.Analyzers\IEC61850_IED_Tool.Analyzers.csproj"
PrivateAssets="all"
ReferenceOutputAssembly="false"
OutputItemType="Analyzer" />
</ItemGroup>- The analyzers exclude
*.Testsassemblies by convention. - Adjust allow-lists in
NoStaticPolicyAnalyzeras needed.