views:

834

answers:

2

Hi there.

I have created a feature in Visual Studio, using WSPBuilder to build the .wsp file, which contains some aspx files that need to be copied to the _layouts folder. I created the 12 hive structure in my project, copied all the xml files (feature.xml for example) to the right subfolders, put the aspx files in the right place and built the .wsp file.

When I deployed and activated the feature, the aspx files were copied to the _layouts folder and all was well. Then, for no reason, SharePoint did was it does best and stopped working. Now, whenever I deploy the feature and activate it, I notice that none of the aspx files are copied to the _layouts folder. I can't see any messages in the log file which point to a problem.

Here is my feature.xml file:

<?xml version="1.0" encoding="utf-8"?>
<Feature  Id="3263C427-F0FA-4cad-8C7F-459F31E36D34"
          Title="Test"
          Description="Test"
          Version="1.0.0.0"
          Hidden="FALSE"
          Scope="Web"
          DefaultResourceFile="core"
          xmlns="http://schemas.microsoft.com/sharepoint/"&gt;
  <ElementManifests>
    <ElementManifest Location="CustomActions.xml" />
    <ElementManifest Location="module.xml" />
  </ElementManifests>
</Feature>

The CustomActions.xml contains some links that are created on the list settings page on a site, so that it being processed fine. The problem is 'module.xml':

<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/"&gt;
  <Module Name="Page1" Url="_layouts">
    <File Url="Page1.aspx" Type="Ghostable" />    
  </Module>
  <Module Name="Page2" Url="_layouts">
    <File Url="Page2.aspx" Type="Ghostable" />
  </Module>
</Elements>

I can't spot what I've done wrong here - in fact, the whole deployment has been working fine with the above files, so I'm just baffled as to why it's stopped working. I did the usual of re-tracing my steps and thinking whether I had done something to cause this, but I haven't.

If anyone has had previous experience of this happening to them, and can give me some tips, then that would be great. Until then, I'll keep trying to get this working, and wondering why, for such a popular platform, SharePoint is more flakey then a teenager with dandruff.

Cheers. Jas.

+5  A: 

Well you dont need to provision the files to _Layouts folder. All you have have to do is just copy. as per your question you are using the wsp builder. You can remove the <ElementManifest Location="module.xml" /> and the Files.

Just place the files in to the 12\TEMPLATE\LAYOUTS folder and run the wspbuilder. Files will go in to _layouts. Provisioning is only for the files that needs to go in to the Site. _Layout files are application pages and it is the best approach to do this.

Kusek
Hi there.That worked a treat, many thanks for explaining this to me, I was getting worried about it not working! You're a star.
Jason Evans
As an additional note, to deploy files to the _layouts folder using VS2010, all you need to do is right click on your Sharepoint Project and select "Add -> Sharepoint Layouts mapped folder" - anything you put in here will be packaged and copied to the _layouts folder as part of the wsp :)
Blakomen
A: 

he he saved hours of my time. thanks for the post! beside all if the published content is images you don't need to give the full path. WSP builder will make sure the content will drop into _layouts/images/. Of cause you have to have the folder structure in wsp builder project. Have fun, Sriwantha Sri Aravinda