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

We have found a problem with our deployment to a production server that runs SharePoint 2010 Publishing Site Collection.

We are deploying WSP packaged from Visual Studio to Sharepoint Management Shell. It has worked like a charm in the past. We added a custom masterpage, css files, images and later we successfully added custom page layouts.

I also have SP running locally on my computer and everything works fine with no problem adding new files via deploying Feature. I can add them neatly into a document library or even create new folders from the Elements file.

However the problem arise when I deploy my WSP to the production server. I want to add a few JS files and a XSL file to the Style Library but the files won't get added to the document library. The deployment process goes smooth though with no errors and when I check my feature in Sharepoint Hive, the new files are there on the physical drive! However they won't get added to the virtual Document Library.

I can update existing files like the masterpage and CSS files so the feature that is deployed is working.

My guess is that either it has to do with permission problems or some bug in my code. But I did exactly as we have done before when deploying.

This is how my Elements.xml file looks like:

<?xml version="1.0" encoding="utf-8"?>  
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">  
  <Module Name="ALayout" Url="_catalogs/masterpage" RootWebOnly="true" >  
    <File Path="ALayout\_a_intra.master" Url="_a_intra.master" Type="GhostableInLibrary" />  
  </Module>  
  <Module Name="ALayoutStyles" Url="Style Library" RootWebOnly="true" >  
    <File Path="ALayout\styles\z_aintra_core.css" Url="z_aintra_core.css" />  
    <File Path="ALayout\styles\aintra_std.css" Url="aintra_std.css" />  
</Module>  
  <Module Name="ALayoutStyleImages" Url="Style Library/img" RootWebOnly="true" >  
    <File Path="ALayout\styles\img\a-logobig.png" Url="a-logobig.png" Type="GhostableInLibrary" />  
    <File Path="ALayout\styles\img\bg.png" Url="bg.png" Type="GhostableInLibrary" />  
    <File Path="ALayout\styles\img\divider.png" Url="divider.png" Type="GhostableInLibrary" />  
    <File Path="ALayout\styles\img\nav-bg-hovered.png" Url="nav-bg-hovered.png" Type="GhostableInLibrary" />  
    <File Path="ALayout\styles\img\nav-bg-radius-left.png" Url="nav-bg-radius-left.png" Type="GhostableInLibrary" />  
    <File Path="ALayout\styles\img\nav-bg-radius-right.png" Url="nav-bg-radius-right.png" Type="GhostableInLibrary" />  
    <File Path="ALayout\styles\img\nav-bg-selected.png" Url="nav-bg-selected.png" Type="GhostableInLibrary" />  
    <File Path="ALayout\styles\img\nav-bg.png" Url="nav-bg.png" Type="GhostableInLibrary" />  
    <File Path="ALayout\styles\img\nav-divider.png" Url="nav-divider.png" Type="GhostableInLibrary" />  
    <File Path="ALayout\styles\img\top_bg.png" Url="top_bg.png" Type="GhostableInLibrary" />  
    <File Path="ALayout\styles\img\user-account-radius-left.png" Url="user-account-radius-left.png" Type="GhostableInLibrary" />  
    <File Path="ALayout\styles\img\user-account-radius-right.png" Url="user-account-radius-right.png" Type="GhostableInLibrary" />  
  </Module>  
  <Module Name="ALayoutScript" Url="Style Library/js" RootWebOnly="true" >  
    <File Path="ALayout\js\script.js" Url="script.js" Type="GhostableInLibrary" />  
    <File Path="ALayout\js\plugins.js" Url="plugins.js" Type="GhostableInLibrary" />  
</Module>  
  <Module Name="ALayoutScriptLibs" Url="Style Library/js/libs" RootWebOnly="true" >  
    <File Path="ALayout\js\libs\jquery-1.4.2.min.js" Url="jquery-1.4.2.min.js" Type="GhostableInLibrary" />  
  </Module>  
</Elements>  

The last two modules (for Javascript) is the ones I can't deploy to the document library. I tried different document libraries but it still doesn't work on production server, just locally. And I can't deploy to Sharepoint Hive via Feature.

Anyone can think of something I missed?

share|improve this question
add comment

3 Answers 3

MSDN answered that if I'm UPGRADING an existing solution, I need to VERSION my features and use feature upgrades to push my new files out. I have no idea how to version my features though. http://social.msdn.microsoft.com/Forums/en/sharepoint2010programming/thread/949ba114-0863-4ccf-bfe6-2eb6b7975315

share|improve this answer
    
But I am uninstalling and then adding solution so versioning shouldn't be a problem? –  Anonymous Nov 16 '10 at 9:22
add comment

Has .js been set up as a blocked file type in Central Admin? I think .jse is blocked by default but mayby some overzealous admin has included .js also. Test by manually trying to upload a js file to any document library in the production farm.

share|improve this answer
    
I can add JS to document library manually in the production farm. I also tried to add the JS files manually and then "update it through deployment" as I thought it was some kind of permissions problem. But I couldn't. The weirdest thing is that it works great on my local SP. –  JimmyLeonardson Nov 15 '10 at 9:54
add comment
up vote 0 down vote accepted

Wow, the solution was simple. I deactivated the feature in Sharepoint administration, and reactivated it and the new files got deployed.

WHY this happened, I don't know. If I version my feature instead of uninstall->add it might get fixed?

share|improve this answer
add comment

Your Answer

 
discard

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