# Persisting output files from source generators

Some time back, I had my own I/O code that [based on some MSBuild property would persist my generated source](https://github.com/kzu/ThisAssembly/commit/65d43b2f6) for troubleshooting. This is no longer needed since you can now set

```markup
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
```

That will emit the sources to the `$(IntermediateOutputPath)/generated/[GeneratorAssembly]/[GeneratorTypeFullName]` folder by default. If you want to also change where the generated sources are placed, you can additionally set the `CompilerGeneratedFilesOutputPath` property.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://til.cazzulino.com/dotnet/persisting-output-files-from-source-generators.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
