Added the plugin yesterday and built some generic endpoints, chased down some issues I was having. I don't expect this to impact the plugins functionality, but I'm able to workaround these for the time being.
PSU Version: 2026.2.2 (also found in 2026.2.4 DLLs)
Host: Windows Server 2025
Web: IIS
DB: SQL
Component: PowerShellUniversal.Language.CSharp
Finding #1 - ApiRequest.Roles is nested under nullable parent SecurityContext and is List<string> not string[]
// expected usage, from current documentation var roles = request.Roles ?? Array.Empty<string>(); // corrected, working var roles = request.SecurityContext?.Roles ?? new List<string>();
Finding #2 - ref/using extraction match literal CRLF. LF-only lines never hit. CSharpExecutionService extracts directives with:
private readonly Regex _reference = new Regex("#ref (.*)\r\n");
private readonly Regex _using = new Regex("#using (.*)\r\n");
Finding #3 - Directive-extraction is not anchored and will hit on comments and string literals. Reference #2.
Finding #4 - Matched `#using` directives are not terminated with `;`. Documentation shows code snippets without trailing `;`
// reproduce with #ref System.Collections #using System.Collections.Generic var roles = request.SecurityContext?.Roles ?? new List<string>(); // corrected with trailing ; on using directive
Hello tomtaylor,
Thank you for the detailed report and for documenting the workarounds you identified.
The four findings are specific enough for us to validate independently, so I would like to reproduce them separately rather than make assumptions based solely on the implementation details.
I will review:
* The current `ApiRequest` / `SecurityContext.Roles` contract against the documented example.
* `#ref` and `#using` behavior with CRLF versus LF line endings.
* Whether directive extraction can also match comments or string literals.
* Whether `#using` requires a trailing semicolon and how that compares with the current documentation.
I will also compare the behavior across the relevant PSU versions so we can determine which findings are documentation discrepancies and which, if reproduced, represent product behavior that requires further review.
Thank you again for providing such a focused reproduction.
Best regards,
Ruben Tapia