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
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?
Can you enable logging (see https://doc.metalama.net/conceptual/configuration/creating-logs) in the
RoslynCodeAnalysisService
process?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!
Thank you for trying.
You should now update the VSX to https://1drv.ms/u/s!AjIdLvQsWyhnhopmn6uFKjxVfG9gVA?e=unIA2S
Metalama.2023.3.3-preview.vsix
VSIX File