I'm using Kentico 9 with MVC. When I add a image to the media library it is not copied to the MVC application. I am using the default media library location which resolves to ~/site/media
but the image is only accessible from the admin domain. admin.site.com/site/media/image.jpg
and not from site.com/site/media/image.jpg
.
For the image to be accessible, I have to manually copy the images to the corresponding folder.
My admin and MVC site are hosted on the same server using two different IIS app pools. However, we plan to separate these in the near future, so its important that this synchronization works correctly.
CMSHashStringSalt
values.based on the Documentation:
By default, content of media libraries is synchronized via web farms and duplicated between Kentico and your MVC application.
EDIT: What is the best practice for configuring media libraries with MVC?
The fix was simply adding <add key="CMSWebFarmServerName" value="MVCApplication"/>
to the MVC application
SOURCE:TLDR
If you plan to run the Kentico and MVC applications on the same domain (for example, distinguished by port numbers and run in different virtual folders), you need to manually assign unique server names to the web farm servers. To set a web farm server name, see Step 5 in Configuring web farms manually.
Since these sites are hosted on the same machine, i needed to specify a unique server name.