I’m attempting to share a MasterPage between multiple DotVVM projects (version 4.2). However, I encounter the following exception:
DotVVM.Framework.Compilation.DotvvmCompilationException: File 'Demo.Web.MasterPage.Views.MasterPage.dotmaster' was not found. This exception is possibly caused because of incorrect route registration.
In an older project using DotVVM 2.0, I successfully achieved this, but in version 4.2, it no longer works. Here’s my MasterPage.dotmaster file (with the build action set to Embedded resource):
Thanks for reaching out, it surely looks like a bug if it worker in an older version.
Could you please share the full stack trace of the exception? I find it weird that the message contains File 'Demo.Web.MasterPage.Views.MasterPage.dotmaster', instead of File 'embedded://Demo.Web.MasterPage/Views/MasterPage.dotmaster'. That either could mean we are calling this function second time with the mangled file name, or you could have another page with @masterPage Demo.Web.MasterPage.Views.MasterPage.dotmaster
Thank you for your prompt response. I appreciate your attention to this matter.
To confirm that the issue is isolated and not influenced by other factors, I created a separate clean project containing only one MasterPage. Despite this, I still encounter the same problem.
Regarding the discrepancy in the exception message, I agree that it’s unusual for it to display the file path without the ‘embedded://’ prefix. This could indeed suggest a potential bug or an unexpected behavior in the DotVVM framework.
I’m sorry, but I still don’t what could cause this. I have also tried in a new project, and it works for me (embeddedmasterpagetest.zip (7.4 KB)). If you already made the repro project, would you mind to share it here?
I see, I forgot we already fixed in 4.2.4 (#1754), you can upgrade to 4.2.6. I’m quite surprised that dotnet does not issue a warning about using 4.2.0, as it has a critical bug