I'm getting this error when trying to get content using the componentPresentationAssembler.GetContent() method:

CPAssembler error: Web control file is not located inside your website.

The path of the DCP folder in storage.config is correct and the folder is inside same website root directory.

  • 2
    I have had this error in past in .NET due to this path setting being case-sensitive. Can you confirm the path is correct, including case? (copy/pasting the path from Windows Explorer was how I solved it) – Nuno Linhares Jun 17 '13 at 13:10
  • 2
    I assume from the fact that you are using a storage config that this is Tridion 2011 or 2013. Can you tag your question with a release version please? It is also worth noting that the path to the DCP folder (in the storage config file) is case sensitive. Unless there is a strong business case not too, I would tend to implement these using RELs as they are far more scalable. More information is on Will's Tridion Developer post here – Jonathan Williams Jun 17 '13 at 13:14
  • Nuno you r right path was wrong i put the correct path now i m getting this error CPAssembler error: WAIPage object not initialized. Make sure to use the ComponentPresentationAssembler constructor that accepts a WAIPage i m intializing CPAssembler like this ComponentPresentationAssembler cpAssembler = new ComponentPresentationAssembler(pageURI); – Abdul Qadir Jun 18 '13 at 6:54
  • when i use intialization like this ComponentPresentationAssembler componentPresentationAssembler = new ComponentPresentationAssembler("tcm:0-0-0", this.Page); i got my previous error again CPAssembler error: Web control file is not located inside your website. – Abdul Qadir Jun 18 '13 at 7:07

Problem solved. The issue was in the cd_storage_config file where I had an item typeMapping set to use the wrong itemExtension. The specific issue was with the entry:

<Item typeMapping="ComponentPresentation" itemExtension=".ascx" storageId="defaultDataFile"/>`

In my case itemExtension was .asp by mistake. I changed it to .ascx and everything works.

| improve this answer | |
  • 1
    Can you tell us what the cause was so that it may guide others that come across this question please? – Jonathan Williams Jun 18 '13 at 9:49
  • Agreed. Will change my downvote once the answer is updated. – Nuno Linhares Jun 19 '13 at 5:35
  • 1
    sorry nuno for late replay i was out of town actual problem was here in this line <Item typeMapping="ComponentPresentation" itemExtension=".ascx" storageId="defaultDataFile"/> in my condition itemExtension was ".asp" by mistake i change it to ".ascx" and everything works – Abdul Qadir Jun 23 '13 at 6:46
  • Abdul, I edited your answer to include the contents of your comment. – Glenn Stevens Jun 24 '13 at 0:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.