TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/atulin/forged/llms.txt
Use this file to discover all available pages before exploring further.
Atulin.Forged NuGet package is a single, self-contained bundle that delivers everything Forged needs. It ships Forged.Core.dll — the runtime library containing FakeAttribute, Faker<TModel>, Forge, and all generator types — alongside Forged.Generator.dll, the Roslyn Source Generator that analyses your [Fake]-annotated types and emits strongly-typed faker classes at build time. You do not need to install separate packages for the generator and the runtime; one reference is all it takes.
Install the Package
Requirements
| Requirement | Detail |
|---|---|
| .NET version | .NET 10 |
| C# nullable reference types | Recommended (<Nullable>enable</Nullable>) — required to use .OrNull() and nullable property types correctly |
| Roslyn | 4.8 or later (bundled with the .NET 10 SDK) |
How the Package Is Structured
Atulin.Forged bundles two assemblies from separate projects into one NuGet package:
The package places
Forged.Core.dll under lib/$(TargetFramework) (the standard runtime library path) and Forged.Generator.dll under analyzers/dotnet/roslyn4.8/cs (the Roslyn analyzer path). MSBuild and the .NET SDK automatically activate analyzers found in that path — no additional <Analyzer> item is needed in your project file.{Name}Faker class is plain C# — the compiler sees it the same as hand-written code. This also means Forged is fully compatible with Native AOT compilation and IL trimming: there is no reflection, no dynamic, and no runtime code generation.
Verifying the Setup
After adding the package reference, create a minimal test to confirm the generator is active. Add a class annotated with[Fake] and build the project:
WidgetFaker will be available in the same namespace. Instantiate it and call Get():
WidgetFaker type is not recognised by your IDE, trigger a build (dotnet build) — the type appears only after the source generator runs. Most IDEs refresh IntelliSense automatically, but a manual rebuild resolves any lingering “type not found” errors.