November, 2009

  • Visual Studio SharePoint Development Blog

    How to deploy a style sheet into content library using Visual Studio 2010 Beta 2


    If you do not want to inherit the look and feel of the out of the box SharePoint application and content pages, you can change it using Cascading Style Sheets (CSS). Style sheets can either be deployed to the Layouts folder or Styles library using Visual Studio 2010.  Files deployed to the Layouts folder reside on the machine’s file system and the files deployed to the Styles Library reside in the content database. You can find more information on the pros and cons of deploying files to the Layouts vs. Styles Library in the following MSDN article, Implementing a Brand in a SharePoint Server 2007 Publishing Site. You can also deploy a style sheet to the Layouts folder using a mapped folder, which is not shown here.

    In order to deploy a style sheet to the content database you will need to follow these steps:

    1. Create an VS 2010 Empty SharePoint project

    2. Add a new “Module”  Item named “Styles” to the project

    3. Delete the sample.txt

    4. Right click on the “Styles” folder and add a .css file(found under web node in the Add New Item dialog) and name it “newstyle.css”, while adding the style tags that you would like to define.

    5. In the elements.xml file, specify the Url of the Module as “Styles Library” and set the file Type as “GhostableInLibrary”

    <Module Name="Styles" Url="style Library">
    <File Path="Styles\newstyle.css" Url="newstyle.css" Type="GhostableInLibrary"/>
    6. Right click on the project and choose deploy. 

    7. The stylesheet should now be deployed to the style library which you can view by going to http://<MachineName>/Style%20Library/Forms/AllItems.aspx

    You can reference the file like any other css file using the path http://<MachineName>/Style%20Library/newstyle.css.

    Pallavi Vajranabhaiah

  • Visual Studio SharePoint Development Blog

    Channel9 Interviews and Demos


    The Visual Studio Team has been releasing a series of Channel 9 interviews and demos on the new SharePoint tools in Visual Studio 2010. Please check them out and give us your feedback!


  • Visual Studio SharePoint Development Blog

    SharePoint Server 2010 Beta is available

    Public beta release of SharePoint Server 2010 was announced today at PDC. This is great news for SharePoint developers because you can start using Visual Studio 2010 Beta2 to develop against SharePoint Server 2010. You can download SharePoint Server 2010 here.
  • Visual Studio SharePoint Development Blog

    Getting Started with the SharePoint Packaging Designers


    Visual Studio 2010 SharePoint Tooling supports packaging of WSP files with visual designers, tool-windows and MSBuild. Here we start by introducing the designers.

    The feature and package designers expose deployment concepts which are familiar to SharePoint developers. These include features, packages and SharePoint items as well as their attributes and contents. Some of them include feature scope, feature dependencies, packaged assemblies, safe-controls, class resources, and more. Additionally, the designers abstract away the more difficult concepts and provide pre-deployment validation rules to avoid common issues when deploying your solutions.  The designers allow advanced users partial or full control of the feature and solution manifest files to merge or add data and view the final product.  Whatever your skill level you’ll find the new designers an exciting addition to your SharePoint development arsenal.

    The best way to get started with packaging is to create a SharePoint project. SharePoint projects come standard with a Features and Package folder in your project. There are 0..n features in a SharePoint project and always 1 package. Here is a sample List Definition project as viewed in the solution explorer.

    Opening the Feature1 designer shows that the List Definition and List Instance SP project items are included by default in the feature. The SharePoint items which are included in the feature are visible in the list on the right. Other available SharePoint items in the solution will be shown in the list on the left if they match the feature’s scope. Remember that you must have a compatible feature scope for SharePoint items to be packaged in this feature. Configuring the feature properties can be done via the property grid and some of these properties are visible on the designer UI.

    In turn, the package designer can be opened to show that the feature is included in the package. Package related properties are exposed on the designer and in the property grid. At this point your solution is ready for packaging. Right click the project node and select Package to generate a WSP in the output directory. Packaging includes validation of the SharePoint package for potential problems, generating the feature.xml and manifest.xml files and packaging all the files for your SharePoint items.

    Here is a look at the contents of the WSP once it is packaged for deployment.

    Further information on Packaging and Deploying SharePoint Solutions can be found on MSDN here. Stay tuned for further updates from the team on SharePoint Tools and packaging in VS 2010. If there are specific topics you’d like us to address please feel free to post them to the comments.

    Erik Cutts

Page 1 of 1 (4 items)