Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

Commerce Content throwing System.IO.FileNotFoundException


Hi All,

I'm experiencing an unusual bug on getting an instance of a variant model (ProductCodeVariant) that inherits from VariationContent using ContentRepository/ContentLoader. 

The content exists in Commerce and can be viewed on the front end, but returns a System.IO.FileNotFoundException on ContentLoader.Get()/ContentRepository.Get().
var product = _contentLoader.Get<ProductCodeVariant>(productRef);
In the above instance productRef is a valid ContentReference.
Iterestingly, TryGet() returns true, but the out object throws the same error. 
At first I assumed it was potentially a Media issue on the content, but newly created instances of ProductCodeVariant throw the same error.
Anyone encountered an issue like this before?
CMS Version - 12.13.1
Commerce Version - 14.8.0
Jan 24, 2023 14:51

Hi Niall,

Have you checked out Foundation Product Service?

Also check the product is setup correctly, available in market / language, prices and inventory are set, etc.


Jan 24, 2023 15:28
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.