Thursday, January 16, 2014

Install-SPSolution : This solution contains resources scoped for a Web application and must be deployed to one or more Web applications. - Planning Deployment of Farm Solutions for SharePoint 2013

Hello folks,

SharePoint 2013 allows users to run sites in SharePoint 2010 mode. That would be possible only with PowerShell command:

Install-SPSolution –Identity Solution.wsp –GACDeployment –CompatibilityLevel {14,15}

Install-SPSolution -Identity Solution.wsp –WebApplication http://localhost/ –GACDeployment –CompatibilityLevel {14,15}

The deployment was successful however I had done lots of branding (masterpages, page layouts, css..) so those seems corrupted while activating the features...

This failed for me.

Ref: http://blogs.technet.com/b/mspfe/archive/2013/02/04/planning-deployment-of-farm-solutions-for-sharepoint-2013.aspx

WelcomePageUrl Property of the Publishing Feature and "Page not found - The page you're looking for doesn't exist." - SharePoint 2013

Hello guys,
After getting the above error, The trick is to name the module like the custom default page - for example in my case my default page name is "defaultCustom.aspx" hence I named the module <Module Name="defaultCustom" />.
Here is the entire onet.xml
<?xml version="1.0" encoding="utf-8"?>
<Project Title="SiteDefinition1" Revision="2" ListDir="" xmlns:ows="Microsoft SharePoint" xmlns="http://schemas.microsoft.com/sharepoint/">
  <NavBars>
  </NavBars>
  <Configurations>
    <Configuration ID="0" Name="SiteDefinition1"  CustomMasterUrl="_catalogs/masterpage/CustomV4.master" MasterUrl="_catalogs/masterpage/CustomV4.master">
      <Lists/>
      <SiteFeatures>

        <!--PublishingPrerequisites Feature-->
        <Feature ID="{a392da98-270b-4e85-9769-04c0fde267aa}"/>

        <!--PublishingResources Feature-->
        <Feature ID="{aebc918d-b20f-4a11-a1db-9ed84d79c87e}"/>

        <!--PublishingLayouts Feature-->
        <Feature ID="{d3f51be2-38a8-4e44-ba84-940d35be1566}"/>

        <!--Publishing Feature-->
        <Feature ID="{f6924d36-2fa8-4f0b-b16d-06b7250180fa}" />

        <!--Sharepoint Server Standard Feature-->
        <Feature ID="{b21b090c-c796-4b0f-ac0f-7ef1659c20ae}" />

        <!--Sharepoint Server Enterprise Feature-->
        <Feature ID="{8581a8a7-cf16-4770-ac54-260265ddb0b2}" />

        <!--Document Set Feature-->
        <Feature ID="{3bae86a2-776d-499d-9db8-fa4cdc7884f8}" />

        <!--Document ID Feature-->
        <Feature ID="{b50e3104-6812-424f-a011-cc90e6327318}" />

        <!--Search Server Webparts Feature-->
        <Feature ID="{eaf6a128-0482-4f71-9a2f-b1c650680e77}" />

        <!-- Termstore Site Features -->
        <Feature ID="73EF14B1-13A9-416b-A9B5-ECECA2B0604C" />

        <Feature ID="7C637B23-06C4-472d-9A9A-7C175762C5C4" />
        
        <Feature ID="AEBC918D-B20F-4a11-A1DB-9ED84D79C87E">
          <Properties xmlns="http://schemas.microsoft.com/sharepoint/">
            <Property Key="AllowRss" Value="false"/>
            <Property Key="SimplePublishing" Value="false" />
          </Properties>
        </Feature>

        <!--Custom Site Feature-->
        <Feature ID="7916bd78-38dd-4595-a02f-68cd4975144a" />

        <!--Custom Master Page Feature-->
        <Feature ID="{66b35b36-fd66-4a16-ab68-d3b47ae8cbf7}" />

        <!--Custom Layout Page Feature-->
        <Feature ID="{7a226876-f2c4-45da-b09b-bd06598cecac}" />
        
      </SiteFeatures>

      <WebFeatures>

        <!-- Publishing feature -->
        <Feature ID="22A9EF51-737B-4ff2-9346-694633FE4416">
          <Properties xmlns="http://schemas.microsoft.com/sharepoint/">
            <Property Key="ChromeMasterUrl" Value="~SiteCollection/_catalogs/masterpage/CustomV4.master"/>
            <Property Key="DefaultPageLayout" Value="~SiteCollection/_catalogs/masterpage/Custom.Layout.aspx"/>
            <Property Key="WelcomePageUrl" Value="$Resources:osrvcore,List_Pages_UrlName;/defaultCustom.aspx" />
            <Property Key="SimplePublishing" Value="true" />
            <Property Key="RequireCheckoutOnPages" Value="False" />
          </Properties>
        </Feature>

        <!--This Feature and Properties corresponds to the Navigation Settings UI page-->
        <Feature ID="541F5F57-C847-4e16-B59A-B31E90E6F9EA">
          <!-- Per-Web Portal Navigation Properties-->
          <Properties xmlns="http://schemas.microsoft.com/sharepoint/">
            <Property Key="InheritGlobalNavigation" Value="true"/>
            <Property Key="ShowSiblings" Value="true"/>
            <Property Key="IncludeSubSites" Value="true"/>
          </Properties>
        </Feature>

        <!-- Enterprise Wiki Feature -->
        <Feature ID="76D688AD-C16E-4cec-9B71-7B7F0D79B9CD" />

      </WebFeatures>

      <Modules>
        <Module Name="defaultCustom" />
      </Modules>
      
    </Configuration>
  </Configurations>

  <Modules>
    <Module Name="defaultCustom" Url="$Resources:osrvcore,List_Pages_UrlName;" Path="">
      <File Url="defaultCustom.aspx" Type="GhostableInLibrary" Level="Draft" >
        <Property Name="Title" Value="$Resources:cmscore,EnterpriseWiki_Site_WelcomePageTitle;" />
        <Property Name="PublishingPageLayout" Value="~SiteCollection/_catalogs/masterpage/Custom.Layout.aspx, Custom Web Part Page" />
        <Property Name="ContentType" Value="$Resources:cmscore,contenttype_welcomepage_name;" />
      </File>
    </Module>
  </Modules>
</Project>

Monday, January 13, 2014

Visual WebPart Template missing in Visual Studio 2012

Hi folks,

Did not know why the Visual Studio Team has changed the SharePoint Visual WebPart Template.

The SharePoint 2010 developers know that the Visual WebPart is nothing but an Asp.Net user control (.ascx) which is loaded by SharePoint from the file system.

However I have recently installed Visual Studio 2012 and got surprised that the template have been changed and go to know that I was not only the one who experienced that.

Resolution: http://chuvash.eu/2012/09/20/the-original-visual-web-part-template-is-missing-in-visual-studio-2012/

Cheers !

AppFabric installation and SharePoint 2013 Installation

While installing SharePoint 2013 - the AppFabric was failing and I noticed 2 erros:

 - Installer MSI returned with error code : 1603
 - The term 'Add-ASAppSqlInstanceStore' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

The solution is to add the below entry to the PSModulePath (System properties -> Environment Variables -> System variables)

C:\Windows\system32\WindowsPowerShell\v1.0\Modules\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\PowerShell\Modules\;C:\Program Files\AppFabric 1.1 for Windows Server\PowershellModules

Cheers !