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"/>

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.

1 Answer 1


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.

  • so in my file element i should only have following link for example: url="Style/Style.css" correct? should the path be same as url?
    – Shkipper
    Jul 4, 2012 at 14:01
  • Yes, if you have a url in your module you need to remove that part of the url in your file ref. Jul 5, 2012 at 13:53
  • yes but what about the path attribute in file element, how should it be structured?
    – Shkipper
    Jul 5, 2012 at 14:08
  • 1
    <Module Name="Style Library" Url="Style Library" RootWebOnly="true"> <File Path="Style Library\Styles\Style.css" Url="Styles/Style.css" type="GhostableInLibrary" /> This should create your file in Style Library/Styles/ Jul 6, 2012 at 6:52
  • I can use "GhostableInLibrary" witouth an URL in the Module tag just fine. How come?
    – Tim
    Sep 20, 2012 at 8:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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