Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 7 down vote accepted

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.

share|improve this answer
    
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 '12 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. –  Kjetil Gullen Jul 5 '12 at 13:53
    
yes but what about the path attribute in file element, how should it be structured? –  Shkipper Jul 5 '12 at 14:08
    
<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/ –  Kjetil Gullen Jul 6 '12 at 6:52
    
I can use "GhostableInLibrary" witouth an URL in the Module tag just fine. How come? –  Tim Sep 20 '12 at 8:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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