How to debug a "Cannot preview the transformed code: unknown error"?

I've got an aspect that's building without error and a target project that's applying the aspect that also builds without error. Despite that, if I attempt to view the Metalama preview of the applied aspect, I get an error "Cannot preview the transformed code: unknown error" in the gold bar in VS. No crash report is generated for this error. Any ideas of how to diagnose what's happening here?
5 Replies
Whit
WhitOP17mo ago
Further, it reads "This generator is not generating files" when I try to read the output under Metalama.Framework.CompilerExtensions, which is probably why it can't show me a preview.. but if it's building without error with the LamaDebug build profile, why isn't it producing an output?
Petr Onderka
Petr Onderka17mo ago
Can you enable logging (see https://doc.metalama.net/conceptual/configuration/creating-logs) in the RoslynCodeAnalysisService process?
Whit
WhitOP17mo ago
Well, chalk it down as another mysterious cause. Enabled the logging, killed metalama, restarted the VS instance and tried to view the code preview and there it is without any issue. But, as it's working, nothing more to do here. I'll try to remember to enable logging next time so I can try pulling something useful to narrow this down. Thanks!
Petr Onderka
Petr Onderka17mo ago
Thank you for trying.
Want results from more Discord servers?
Add your server