Skip to content

Need to document EmitCompilerGeneratedFiles for "No ModelReaderWriterTypeBuilder found for [Name]" #52688

@cataggar

Description

@cataggar

The documentation linked to https://aka.ms/no-modelreaderwritertypebuilder-found is not quite correct.

## No ModelReaderWriterTypeBuilder found
If you encounter an error message like "No ModelReaderWriterTypeBuilder found for [Name]", it means that ModelReaderWriter attempted to read or write
a type for which no appropriate ModelReaderWriterTypeBuilder exists in your context.
Troubleshooting Steps
1. Ensure you have the System.ClientModel.SourceGeneration analyzers installed. In general simply adding
a package reference to System.ClientModel will do this but you can verify in your project dependencies that you see the reference.
2. Ensure you have a public partial class that inherits from [ModelReaderWriterContext](#context-class).
3. If the type is one of the [supported collections](#supported-collection-types) then add the [ModelReaderWriterBuildableAttribute](#modelreaderwriterbuildableattribute) for your missing type.
4. If the type is not one of the [supported collections](#supported-collection-types) then add a [custom type builder](#custom-type-builders) for your missing type.

Instead, I had to add this line:

<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>

Files then generated correctly:

Image

I'm not sure if changes for this issues are related:

Metadata

Metadata

Assignees

Labels

ClientThis issue is related to a non-management packageDocsSystem.ClientModelBase Core library

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions