umbraco-contentment: [v3.0] Unable to build project

Which Contentment version are you using?

3.0.0

Which Umbraco version are you using? For example: 8.14.1 - don’t just write v8

9.0.1

Bug summary

Unable to build project after upgrading from the beta to 3.0.0 stable

Steps to reproduce

Upgrade from 3.0.0-beta001 to 3.0.0 stable

Expected result / actual result

Expected the project to build, instead I get the following errors:

error CS0246: The type or namespace name 'ContentBlockPreviewView' could not be found (are you missing a using directive or an assembly reference?)
error CS0115: 'App_Plugins_Contentment_render_ContentBlockPreview.ExecuteAsync()': no suitable method found to override

Do you have Umbraco ModelsBuilder enabled?

  • Yes, it is enabled.

What browsers are you seeing the problem on?

No response

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 17 (5 by maintainers)

Commits related to this issue

Most upvoted comments

Thanks for the update @leekelleher, no rush from me… the beta is currently working fine, I was only updating prior to launch on Sunday (31st) evening 😃

Update on this one. I added a _ViewImports.cshtml file to the “~/App_Plugins/Contentment/render” directory, with the contents…

@using Umbraco.Cms.Web.Common.Views;

…and the project compiles fine. 🎉

The reason I omitted the namespace from the Razor view is that the ContentBlockPreviewView class has different namespaces between the v8 and v9 versions. Rightly or wrongly, I wanted to align them with Umbraco’s namespaces for the view models.

I’ll get a patch release out soon. 👍 (I’m doing the usual juggling work/family/OSS 🤷😆)

@leekelleher there are the RazorCompileOnBuild and RazorCompileOnPublish settings in the csproj file, however the default csproj that comes with Umbraco v9 says to set those to “true” unless you are using Models Builder in InMemoryAuto mode.