5
votes

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 (Uninstall, reinstall solution). 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?

2
does the folder js already exist?brian brinley
First I thought that was the problem so I added a folder manually. Still it didn't work. I tried to deploy directly to Style Library too. I also tried different folders for example, _catalogs/_masterpage, _layouts etc. No luck. And the XSL file (Not in code) needs to be added to the Style Library/XSL Style Sheets/ Folder because I need it for CQWP styling, so adding to the Sharepoint Hive is no solution.Anandasama
Are you sure it is not hitting any errors? It sounds like it might be hitting an error and stopping processing before it gets to the JS files. Your XML file looks ok, so the problem is somewhere else: most likely in your code or in the server configuration.Peter Jacoby
on my VM it doesn't hit any errors. Every file gets deployed as it should. I'm not sure how to debug on my production farm. When I install (uninstall+install) the WSP in Powershell it doesn't give me any error. I made a mirror post on MSDN and I posted our Power Shell script and the log there. social.msdn.microsoft.com/Forums/en/sharepoint2010programming/…Anandasama

2 Answers

5
votes

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? Why is the behavior different on the production farm vs local? etc.

1
votes

There are few points I want yo bring to your notice. Just check if you are already following them...

  1. I hope you have "js" folder in your VS solution (under ALayout module).

  2. Add IgnoreIfAlreadyExists="FALSE" attribute to the node

    File Path="ALayout\js\libs\jquery-1.4.2.min.js" Url="jquery-1.4.2.min.js" Type="GhostableInLibrary" IgnoreIfAlreadyExists="FALSE"/

  3. Use ULSViewer to see any errors while deploying on production...