U4-10737 - 7.7.6 Pre-compilation error in Umbraco/PartialViewMacros/Template

Created by Kevin Kopto 07 Dec 2017, 11:32:05 Updated by Lee Cichanowicz 25 Jun 2018, 17:13:25

After upgrading from 7.6.3 to 7.7.6 pre-compilation of several views in /umbraco folder no longer works.

aspnet_compiler.exe gives the following errors:

Umbraco\PartialViewMacros\Templates\Gallery.cshtml(40,0): Error CS0246: The type or namespace name 'Image' could not be found (are you missing a using directive or an assembly reference?)

When I change this line @helper Render(Image item) to @helper Render(dynamic item) I get these follow-up errors:

Umbraco\PartialViewMacros\Templates\Gallery.cshtml(28,0): Error CS0246: The type or namespace name 'Image' could not be found (are you missing a using directive or an assembly reference?) Umbraco\PartialViewMacros\Templates\Gallery.cshtml(32,0): Error CS0246: The type or namespace name 'Image' could not be found (are you missing a using directive or an assembly reference?) Umbraco\PartialViewMacros\Templates\Gallery.cshtml(32,0): Error CS0307: The property 'IPublishedContent.Children' cannot be used with type arguments

Same goes for:

Umbraco\PartialViewMacros\Templates\ListImagesFromMediaFolder.cshtml

See recent changes in https://github.com/umbraco/Umbraco-CMS/blob/master-v7/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Gallery.cshtml and https://github.com/umbraco/Umbraco-CMS/blob/master-v7/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListImagesFromMediaFolder.cshtml

OS: Windows 10 Pro x64 IDE: Visual Studio 2017 (15.5.0) target framework: .NET 4.6.2

1 Attachments

Comments

Lee Cichanowicz 20 Jun 2018, 22:17:28

This is still happening in 7.11.0


Sebastiaan Janssen 21 Jun 2018, 08:38:24

These files are there for convenience, the backoffice editor uses them for you to make a quick start by using a pre-existing template for macro files.

Make sure to not build these files, they're not supposed to be built at all in VS :-) The NuGet installer doesn't include them in the solution for this very reason.


Lee Cichanowicz 25 Jun 2018, 17:13:25

Thanks for the prompt reply @sebastiaan. It seems your team set up a [https://umbraco.com/products/umbraco-cms/download-umbraco/ Download] page without telling you. ;]

I know from setting up new sites via NuGet, "Don't forget to build!" But, the site I inherited came from a download/ZIP file installation, so obviously those files were not excluded, because it wasn't even a Solution, just a "dumb" website. I had created a Website Project in VS. I used a trick from SO to [https://stackoverflow.com/a/6106598 exclude files/folders in a Website Project].


Priority: Normal

Type: Bug

State: Closed

Assignee:

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions: 7.7.6

Due in version:

Sprint:

Story Points:

Cycle: