Reputation: 1
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):
@viewModel Demo.Web.MasterPage.ViewModels.MasterPageViewModel, Demo.Web.MasterPage
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
...
</head>
<body>
<dot:ContentPlaceHolder ID="MainContent" />
</body>
</html>
And here's an example Page1.dothtml with the master page embedded:
@viewModel Demo.Module1.ViewModels.Page1ViewModel, Demo.Module1
@masterPage embedded://Demo.Web.MasterPage/Views/MasterPage.dotmaster
<dot:Content ContentPlaceHolderID="MainContent">
</dot:Content>
I've tried various path combinations, but none seem to work. Any insights into resolving this issue would be greatly appreciated. Thank you!
I've attempted several approaches to resolve this issue:
I ensured that the MasterPage.dotmaster file is set to the correct build action (Embedded resource). I experimented with different path combinations in the @masterPage directive in my DotHTML files. I double-checked the correctness of route registration. I compared my setup with the successful implementation in DotVVM 2.0.
I expected that by embedding the MasterPage and specifying the correct path in the @masterPage directive, DotVVM 4.2 would be able to locate and use the MasterPage across multiple projects, similar to how it worked in DotVVM 2.0. However, despite these efforts, I still encounter the 'File Not Found' exception mentioned in the question.
Upvotes: 0
Views: 29