I don't know if somebody has faced this strange behaviour.
I'm implementing a new site with DXA, version 1.7 and .NET with SDL Web 8.5.
I have mounted the DxaWebApp visual studio solution, with the Core views included, and make a "custom" module with my custom views. Then I have changed the default module to my own module to override the core views.
Then all works well, but my images (binaries of type "Image") are not displayed, resulting in a 404 not found of the url of the image.
The way I handle the images is the same as other views in the Core example, with:
@Html.Media(Model.image)
The url is ok, and the binary contents are in the broker database, but the problem comes when the "admin/refresh" mechanism has to check if the image is in the caché, and if it is not, then write the image file to the "BinaryData/publicationId" directory of the Site.
I have checked a default DXA site, and the differences in the log traces are:
When the image is not found by the BinaryFileManager.GetCahedFile(...) the "WriteBinaryToFile" method is not executed in my site and exits.
2017-09-15 21:24:22,721 [8] TRACE - DefaultContentProvider.GetStaticContentItem("/Images/rewards-logo_tcm2010-2388_w1024_h1024_n.png", 2010 ('Spanish')) entry.
2017-09-15 21:24:22,727 [8] TRACE - BinaryFileManager.GetCachedFile("/Images/rewards-logo_tcm2010-2388_w1024_h1024_n.png", 2010 ('Spanish')) : "C:\dev\Site\BinaryData\2010\Images\rewards-logo…" entry.
2017-09-15 21:24:22,732 [8] DEBUG - No value cached for key '/Images/rewards-logo_tcm2010-2388.png' in region 'BinaryPublishDate'.
2017-09-15 21:24:22,799 [8] TRACE - BinaryFileManager.GetCachedFile() exit. Duration: 66 ms.
2017-09-15 21:24:22,803 [8] TRACE - DefaultContentProvider.GetStaticContentItem() exit. Duration: 76 ms.
In a correct scenario, after the getCachedFile finds no image, a WriteBinaryToFile is executed and all works well
2017-09-15 21:27:27,725 [19] TRACE - DefaultContentProvider.GetStaticContentItem("/Images/planes_tcm2010-1312_w1024_n.jpg", 2010 ('Spanish')) entry.
2017-09-15 21:27:27,728 [19] TRACE - BinaryFileManager.GetCachedFile("/Images/planes_tcm2010-1312_w1024_n.jpg", 2010 ('Spanish')) : "C:\dev\Site\BinaryData\2010\Images\planes_tcm2010-1312_…" entry.
2017-09-15 21:27:27,731 [19] DEBUG - No value cached for key '/Images/planes_tcm2010-1312.jpg' in region 'BinaryPublishDate'.
2017-09-15 21:27:30,611 [19] TRACE - BinaryFileManager.WriteBinaryToFile(255; 216; 255; 224; 0; 16; 74; 70; 73; 70; 0; 1; 1; 1; 0; 96; 0;…, "C:\dev\Site\BinaryData\2010\Images\planes_tcm2010-1312_…", (W=1024, H=0, NoStretch=True)) entry.
2017-09-15 21:27:30,621 [19] TRACE - BinaryFileManager.ResizeImage(641261, (W=1024, H=0, NoStretch=True), Jpeg) entry.
2017-09-15 21:27:31,372 [19] TRACE - BinaryFileManager.ResizeImage() exit. Duration: 746 ms.
2017-09-15 21:27:31,380 [19] TRACE - BinaryFileManager.WriteBinaryToFile() exit. Duration: 762 ms.
2017-09-15 21:27:31,382 [19] TRACE - BinaryFileManager.GetCachedFile() exit. Duration: 3652 ms.
2017-09-15 21:27:31,387 [19] TRACE - DefaultContentProvider.GetStaticContentItem() exit. Duration: 3659 ms.
I don't know where this behaviour may be coming, I have changed a lot of region/entity/page view names but nothing happens, and I don't know where to view or debug this issue, or what else to try!
PROBLEM SOLVED
I finally found the problem, a shameful one; I was using the default component template instead of the DXA component template, and the images were being published without the tcmUri information. That was the reason for not finding the pictures.
But I'm still amazed by the fact that all the text fields of my components were been resolved ok in the DXA application.
Sorry guys.