Question

Here is the module which I want to deploy on the server and the files which should be shown in the Style Library, when deploying them without type ghostale in library, all go good and well, no errors, but as soon as I put the type ghostableInLibrary, I recieve the following error:

Error occurred in deployment step 'Activate Features': Failed to instantiate file "filepath" from module Style Library: The specified list does not exist.

I understand what error says, but how can it be? The list does exists and it has the subfolders and everything, so why do I get this strange error? And how to solve this?

<Module Name="Style Library" RootWebOnly="true">
    <File Path="Style Library\Styles\Style.css" Url="Style Library/Styles/Style.css" type="GhostableInLibrary"/>
    <File Path="Style Library\Images\logo.png" Url="Style Library/Images/logo.png" type="GhostableInLibrary"/>
    <File Path="Style Library\Images\banner.png" Url="Style Library/Images/banner.png" type="GhostableInLibrary"/>
 </Module>

I did find some old post here about that problem, but there wasn't acceptable solution provided, so that is why I created a new post.

Was it helpful?

Solution

You need to move the list Url to your module definition:

<Module Name="Style Library" Url="Style Library" RootWebOnly="true">

for GhostableInLibrary to work properly. You should of course then remove it from the File Url, since it is now defined on module level.

If you have no Url in the Module tag you can only use type="Ghostable" on your File elements.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top