1

I'm testing a Maui app that uses CommuniytToolkit.Mvvm to generate [ObservableProperty] attributes. The ViewModel partial class is generated for Android and Windows; I can see it in Dependencies, but the Debugger can't find it and prompts for it. The problem is generated code is in-memory only, not a file. The debugger works for Android but can't find the generated code on Windows.

I haven't been able to find a workaround so far.

Guru Stron
  • 102,774
  • 10
  • 95
  • 132
Gary Lewis
  • 45
  • 5

1 Answers1

0

Try adding EmitCompilerGeneratedFiles element (and potentially CompilerGeneratedFilesOutputPath) to the .csproj. Something like this:

<PropertyGroup>
    <EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
    <CompilerGeneratedFilesOutputPath>path_to_output_folder</CompilerGeneratedFilesOutputPath>
</PropertyGroup>

Read more:

Guru Stron
  • 102,774
  • 10
  • 95
  • 132