Where should the files go in a SharePoint solution

deploymentorganizationsharepointsharepoint-2010

Our SharePoint solution has recently been upgraded to SharePoint 2010, and we are taking a look at how we package and deploy the site to see if there are better ways to do things.

We currently package all files needed for our site (dll's, images, svc files, xap files, js files, css files, masterpages, html files, aspx files) and deploy them to 14/template/features/OurFeature/

I've been doing a lot of reading about SharePoint Developer Tools in Microsoft Visual Studio 2010, and I would like to use this to package/deploy our solution. It seems Visual Studio allows for mapped folders to SharePoint's images and layouts directories, and also allows other mapped folders. I'm wondering if there are standard locations for any of the other file types that I have mentioned above, or is our current method of storing things in the template/features folder a good idea? We currently map things to this folder in IIS, so ~/images/ points to our site's images and so forth.

Can someone point me to best practices for SharePoint site file organization? Are there benefits to doing things one way versus another?

Best Answer

  • Images should go in 14\TEMPLATE\IMAGES or an Image Library (I usually use an image library so images can be changed without forcing a deployment).

  • Client Libraries (.xap files, .js files, etc.) should go in 14\TEMPLATE\LAYOUTS\ClientBin

  • .dll files should get sent to the GAC or the BIN directory for the web application running the assembly

  • .css files can live in a document library, ClientBin, a custom folder under 14\TEMPLATE\Layouts, or 14\TEMPLATE\LAYOUTS\STYLES (I usually put these in a style library so they can be changed if needed without having to re-deploy the whole solution.)

  • .svc files should go in 14\ISAPI. These are accessed under the /_vti_bin/ path.

  • Features go in 14\TEMPLATE\FEATURES

Related Topic