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?
Xaniff
Xaniff263d 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 Onderka263d ago
Can you enable logging (see https://doc.metalama.net/conceptual/configuration/creating-logs) in the RoslynCodeAnalysisService process?
Xaniff
Xaniff263d 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 Onderka263d ago
Thank you for trying.
Gael Fraiteur
Gael Fraiteur261d ago
Want results from more Discord servers?
Add your server
More Posts
Warn on ineligibility instead of throwingI've got two conditions in my BuildEligibility for a method override aspect: If the target type is aReferencing value assigned to variable in statement builder within another statementGiven a statement that does something like: ```cs var expr = new ExpressionBuilder(); expr.AppendVerSpecifying generic constraints of compile-time introduced typeI have a TypeAspect that has three attribute arguments when applied to a type. One of these is a `TyStep-through aspect-debuggingI'm sure I've asked this before, but I cannot find the thread in which it was answered (if I actuallCodeLens HelpMetalama is configured in CodeLens, and I have an aspect that has been applied. I am able to right-How to apply an attribute to a method introduced by another aspect?I have an aspect that has a dependency on another aspect. However, I'd like for downstream projects Advising the addition of code commentsUsing Metalama Is there a way to advise adding code comments? For example, when I advise a method Set eligibility to not run against (built-in) methods of record classes or structsI've figured out how to set up an `If` statement for the record types, but I cannot figure out how tHow to specify an IMethod as the callback for an event?I'd like to specify an introduced method on a TypeAspect as the callback for an event handler. 1) WCreate NuGet with MetalamaWith source generators I have to add some MSBuild configuration, but with Metalama it seems I don't Override property with BuildAspectI create exceptions inheriting from Exception and putting the `[BusinessException]` attribute. I waView diff in RiderI don't use Visual Studio, and overall, I don't have Windows. Is there any way to see the source genOverride constructorIs it possible to override a constructor? I want to take my code: ``` public class BusinessExceptiDoes Metalama only support attributes?I navigated in all Metalama documentation, but I want to override a method for all types that inheri