Dashon
Dashon

Reputation: 31

Kentico Media Library not syncing with MVC project

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.

  1. Under Web Farms, I have only one active server.
  2. Both web.config files have the same 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?

Upvotes: 2

Views: 1008

Answers (3)

Dashon
Dashon

Reputation: 31

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.

Upvotes: 1

Rui
Rui

Reputation: 494

Do you have the Admin and MVC running as two site under IIS pointing to the same database? Also, do you have the license key with 2 servers modifier? (you will need to request that from your sales rep)

Upvotes: 0

mnield
mnield

Reputation: 1869

My understanding of the MVC setup is that you should either have two servers setup manually in your web farm or have the web farm set to auto. As you only have one, there is nothing to synchronize. That you only have one server in your server list makes me think that the synchronization is not going to work. If your web farm is set to auto, perhaps try to configure it manually.

Upvotes: 0

Related Questions