The type or namespace name 'Image' could not be found (are you missing a using directive or an assembly reference?)
Hi,
i just started my free trail umbraco cloud,
i cloned the project locally and at the first build i got 5 errors:
Severity Code Description Project File Line Suppression State
Error 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\
this is my Gallery.cshtml code.
@inherits Umbraco.Web.Macros.PartialViewMacroPage
@*
Macro to display a gallery of images from the Media section.
Works with either a 'Single Media Picker' or a 'Multiple Media Picker' macro parameter (see below).
How it works:
- Confirm the macro parameter has been passed in with a value
- Loop through all the media Ids passed in (might be a single item, might be many)
- Display any individual images, as well as any folders of images
Macro Parameters To Create, for this macro to work:
Alias:mediaIds Name:Select folders and/or images Type: Multiple Media Picker
Type: (note: You can use a Single Media Picker if that's more appropriate to your needs)
*@
@{ var mediaIds = Model.MacroParameters["mediaIds"] as string; }
@if (mediaIds != null)
{
<div class="row">
@foreach (var mediaId in mediaIds.Split(','))
{
var media = Umbraco.TypedMedia(mediaId);
@* a single image *@
if (media.DocumentTypeAlias == "Image")
{
@Render(media as Image);
}
@* a folder with images under it *@
foreach (var image in media.Children<Image>())
{
@Render(image);
}
}
</div>
}
@helper Render(Image item)
{
<div class="col-xs-6 col-md-3">
<a href="@item.Url" class="thumbnail">
<img src="@item.GetCropUrl(width:200, height:200)" alt="@item.Name" />
</a>
</div>
}
The type or namespace name 'Image' could not be found (are you missing a using directive or an assembly reference?)
Hi, i just started my free trail umbraco cloud, i cloned the project locally and at the first build i got 5 errors: Severity Code Description Project File Line Suppression State Error 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\
this is my Gallery.cshtml code.
See here: https://our.umbraco.com/forum/umbraco-cloud/91962-build-error
Hi
Add to header, please:
Thanks,
Alex
And of course read the topic that Tor pointed - https://our.umbraco.com/forum/umbraco-cloud/91962-build-error#comment-293056
Can be the case
Hi
Is this topic solved?
is working on a reply...