Skip to content

Options source generator shouldn't use random names #90990

@eerhardt

Description

@eerhardt

string suffix = $"_{new Random().Next():X8}";
_staticValidationAttributeHolderClassName += suffix;
_staticValidatorHolderClassName += suffix;

Generated code should be deterministic. Many companies and orgs have requirements around deterministic builds.

          Is this the code that prompted https://github.com/dotnet/roslyn-analyzers/pull/6882/? Should we change this code to not use Random, and instead be deterministic?

cc @jaredpar

Originally posted by @eerhardt in #89148 (comment)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions