Developer forum

Currently discussing: Plans to implement a Consent module for GDPR compliance.

Join the discussion!

Forum » PIM » PIM Crashes when image folder is (re)moved

PIM Crashes when image folder is (re)moved

Imar Spaanjaars

I get the following exception when the image folder for a product is removed or renamed:

Server Error in '/' Application.

Could not find a part of the path 'D:\Projects\Dynamicweb\Sites\\Files\Images\RizzoDesignFolder\Products'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.IO.DirectoryNotFoundException: Could not find a part of the path 'D:\Projects\Dynamicweb\Sites\\Files\Images\RizzoDesignFolder\Products'.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace: 

[DirectoryNotFoundException: Could not find a part of the path 'D:\Projects\Dynamicweb\Sites\\Files\Images\RizzoDesignFolder\Products'.]
   System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +271
   System.IO.FileSystemEnumerableIterator`1.CommonInit() +313
   System.IO.Directory.GetFiles(String path, String searchPattern, SearchOption searchOption) +117
   Dynamicweb.Admin.eComBackend.PimMultiEdit.GetImageFromShopPattern(Shop productShop, String imageCompiled) +698
   Dynamicweb.Admin.eComBackend.PimMultiEdit.GetImagesFromPatterns(Product product, String groupId) +733
   Dynamicweb.Admin.eComBackend.PimMultiEdit.GetImagePath(Product product, String groupId) +90
   Dynamicweb.Admin.eComBackend.ProductList.ProductImage(Product prod, String groupId) +31
   Dynamicweb.Admin.eComBackend.ProductList.AddRow(Product prod, String groupId, Int32 index, String langId, Boolean addStockColumns) +2589
   Dynamicweb.Admin.eComBackend.ProductList.LoadData() +277
   Dynamicweb.Admin.eComBackend.ProductList.Page_Load(Object sender, EventArgs e) +756
   System.Web.UI.Control.OnLoad(EventArgs e) +103
   System.Web.UI.Control.LoadRecursive() +68
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1381



1. Create a new product and assign it a small image like /Files/Products/MyProduct1.jpg

2. Save your changes.

3. In the file manager, rename the containing folder. For example, rename /Files/Products to /Files/ProductImages

4. Go back to Ecommerce (double-click the top icon to reload everything) and browse to the group that contains the image.

Expected outcome 

- The product is shown, and the image control is cleared (or a warning shows up?)

Actual outcome:

- The error from above.


Olga Shedko
Olga Shedko

Hello Imar,

This issue is not reproducible anymore in the latest release (looks like it was fixed recently). You should upgrade up to 9.3.12

Now if file/folder was removed/renamed - User doesn't get exception, the product is shown, the image control is cleared, console shows status 404 Not found (which is correct).

Would you please confirm that this issue could be closed.

Thank you.

Best regards,

Olga | QA


Imar Spaanjaars

Hi Olga,

Thanks for getting back to me. It still reproduces for me on 9.3.12 unfortuately:


Olga Shedko
Olga Shedko
This post has been marked as an answer

Hello Imar,

Thanks a lot for your feedback and provided video.

After investigating we understood why we could not reproduce it. The bug exists. For it's reproducing the folder (subfolder) used for images must be selected as "Image folder" in the shop settings Alternative images section (Ecommerce -> Product catalog -> Shop -> Edit shop). If selected the upper level folder - exception doesn't occur. 

I've created TFS Bug 45493. Should be available with the next hotfix release. 

Best regards,


Votes for this answer: 1
Imar Spaanjaars

Thanks Olga, that explains a lot.


Kristian Kirkholt
Kristian Kirkholt

Hi Imar

The problem regarding #45493 "Ecomm/PIM: System.IO.DirectoryNotFoundException when image folder renamed/removed/moved" has now been resolved in Dynamicweb version 9.4.1

To upgrade please choose this version from backend or download from here:

Let me know if you need any more help regarding this

Kind Regards
Dynamicweb Support
Kristian Kirkholt


You must be logged in to post in the forum