SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a root site collection and a user control stored in controltemplates. http://root

I have another site collection under here http://root/fs which also uses this user control but uses its own customised control style sheet.

I am trying to deploy a stylesheet into the style library of each, but am getting...

Error occurred in deployment step 'Activate Features': Failed to instantiate file "fs/Style Library/mega-drop-down.css" from module "FS Style Sheets": The specified list does not exist.

for the subsite.

Do i need to specify the site collection elsewhere as it seems to be accessing it as a sub folder rather than a site?

Here's my manifest:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="">
  <Module Name="FS Style Sheets" Url="fs/Style Library">
    <File Path="FS\styles\mega-drop-down.css" Url="mega-drop-down.css" Type="GhostableInLibrary" IgnoreIfAlreadyExists="TRUE" />
share|improve this question

Note the Model URL and the File path of the File. Those should point to the same place, for example

<Module Name="Pages" Url="Pages">
<File Path="Pages\myPage.aspx" Url="myPage.aspx" Type="GhostableInLibrary" />


share|improve this answer
Hmm not in my XP, the Path is only pointing to your own local dev files, they don't have to match – BobTodd Jan 16 '12 at 14:17

Don't put fs in the Url attribute of the Module element. It's not needed. The Url attribute is site collection relative.

share|improve this answer
so how to specify a specific site? – BobTodd Jan 16 '12 at 14:17
The feature is activated within the context of a site collection, so you don't need to specify one at all. – James Love Jan 16 '12 at 14:18
and visual studio makes you specify this, see my answer below – BobTodd Jan 16 '12 at 14:21
see my comment on your answer. – James Love Jan 16 '12 at 14:23
how to i get it to activate in the site /fs then? – BobTodd Jan 16 '12 at 14:26
up vote 1 down vote accepted

I have found a way around this, and that is to create a new visual studio sharepoint project, but point the project deployment url to the /fs site. Obviously this has to be unique on a project by project basis.

I'd be interested in an answer that shows deployment & activation to two separate sites from the same project.

Maybe its a just a limitation in VS that only lets you activate to one site - same as you can only choose to have all features in a project activate or not, not selectively on a per feature basis.

share|improve this answer
The site for which you choose to deploy a solution to is solely for debugging purposes. If you choose a farm solution to be deployed at http://x then the package generated from that will deploy on any other SharePoint 2010 installation using powershell. – James Love Jan 16 '12 at 14:23
Additionally, the site which you specify to deploy to is not hard coded anywhere within the solution package files at all. Like I said, it's solely used for debugging purposes. – James Love Jan 16 '12 at 14:25
Finally - are you developing on a production server? – James Love Jan 16 '12 at 14:25
so VS doesnt use that property as its activation path? – BobTodd Jan 16 '12 at 14:27
See here how you pass in the activation URL via powershell -… – James Love Jan 16 '12 at 14:32
  1. To use Style Library you need a Publishing site. Or at least a version of that Library taken from a Publishing site.
  2. the Style Library, by default is only a Top-Level site library, therefore it doesn't exist at sub-site level.

If you plan to use a module to deploy your styles, use the RootWebOnly=TRUE on the Module which, even if your feature is Web targeted will always deploy only for the TopLevel. Otherwise your feature might look the Web Level for that Library always.


share|improve this answer

Your Answer


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.