Skip to content

Output behavior

Entry pointOutput deletion default
NuGet MSBuild integrationCratisProxiesSkipOutputDeletion=true: retain the directory and update incrementally
Direct executableDeletes the output directory unless --skip-output-deletion is supplied

Use a dedicated, generated-only directory with one generation owner. Incremental mode does not disable orphan cleanup or guarantee preservation of a mixed source tree.

This fragment belongs inside your existing project:

<PropertyGroup>
<CratisProxiesSkipOutputDeletion>true</CratisProxiesSkipOutputDeletion>
</PropertyGroup>

The generator compares generated content hashes with inline metadata on existing files. A matching hash lets it skip the write and preserve both filesystem and inline timestamps. Renamed or removed artifacts are still cleaned up by file tracking.

Do not edit generated files manually. The metadata/hash shortcut is not a merge tool, and changes to generated content can be overwritten on later builds.

To rebuild a disposable output directory from scratch:

<PropertyGroup>
<CratisProxiesSkipOutputDeletion>false</CratisProxiesSkipOutputDeletion>
</PropertyGroup>

Generated metadata embeds the generation time in file content. Deleting existing files prevents the hash shortcut from preserving that timestamp, so unchanged backend contracts can still produce Git diffs on regeneration.

By default, the generator manages index.ts exports for generated files. Disable that update phase with:

<PropertyGroup>
<CratisProxiesSkipIndexGeneration>true</CratisProxiesSkipIndexGeneration>
</PropertyGroup>

This skips barrel creation/update, not deletion. Full output deletion still removes indexes, and orphan-directory cleanup can delete an index.ts even when this property is true. Keep a handwritten public barrel outside the generator’s output tree if you need ownership isolation.

CratisProxiesSkipFileIndexTracking is still exposed by the build package and forwards --skip-file-index-tracking. The current executable does not parse that flag. Setting it to true does not disable metadata scanning or stale-file deletion. There is no supported orphan-cleanup opt-out in the current executable.

The old JSON file index and --project-directory setting are not used by current tracking. See file tracking and preservation limits before changing cleanup settings.

CLI examples in this section assume proxygenerator is an application-provided alias or wrapper for the packaged .NET executable; the build package does not install that shell command. The first arguments are the compiled assembly path, output path, and optional namespace segment count.

Terminal window
proxygenerator assembly.dll output-path --skip-output-deletion --skip-index-generation

This retains the output directory and skips barrel updates, but still removes orphaned marked files. Use only a disposable or generator-owned output-path.