SharePoint 2013: Import, validate, and manage app licenses

Learn how to import and manage app licenses, as well as how to retrieve, validate, and communicate licensing states in your apps for SharePoint. Using the tools in the sample, developers can import test licenses, validate licenses, and manage license assignment within SharePoint.

C# (2.2 MB)
 
 
 
 
 
4.3 Star
(6)
1,490 times
Add to favorites
6/20/2013
E-mail Twitter del.icio.us Digg Facebook

Solution explorer

C#
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>
    </ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <ProjectGuid>{036E1385-ADCD-4B07-93E0-CA9205DE6688}</ProjectGuid>
    <OutputType>Library</OutputType>
    <RootNamespace>LicenseSPAppSampleWeb</RootNamespace>
    <AssemblyName>LicenseSPAppSampleWeb</AssemblyName>
    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
    <UseIISExpress>true</UseIISExpress>
    <IISExpressSSLPort>44313</IISExpressSSLPort>
    <IISExpressAnonymousAuthentication />
    <IISExpressWindowsAuthentication />
    <IISExpressUseClassicPipelineMode />
    <SccProjectName>SAK</SccProjectName>
    <SccLocalPath>SAK</SccLocalPath>
    <SccAuxPath>SAK</SccAuxPath>
    <SccProvider>SAK</SccProvider>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="Microsoft.CSharp" />
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Core" />
    <Reference Include="System.Data.DataSetExtensions" />
    <Reference Include="System.Runtime.Serialization" />
    <Reference Include="System.ServiceModel" />
    <Reference Include="System.Web.Extensions" />
    <Reference Include="System.Xml.Linq" />
    <Reference Include="System.Drawing" />
    <Reference Include="System.Web" />
    <Reference Include="System.Xml" />
    <Reference Include="System.Configuration" />
    <Reference Include="System.Web.Services" />
    <Reference Include="System.EnterpriseServices" />
    <Reference Include="System.Web.DynamicData" />
    <Reference Include="System.Web.Entity" />
    <Reference Include="Microsoft.IdentityModel">
      <Private>True</Private>
    </Reference>
    <Reference Include="Microsoft.IdentityModel.Extensions">
      <Private>True</Private>
    </Reference>
    <Reference Include="Microsoft.SharePoint.Client, Version=15.0.0.0">
      <Private>True</Private>
    </Reference>
    <Reference Include="Microsoft.SharePoint.Client.Runtime, Version=15.0.0.0">
      <Private>True</Private>
    </Reference>
    <Reference Include="System.IdentityModel" />
    <Reference Include="System.Web.ApplicationServices" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="Pages\AppIcon.png" />
    <Content Include="Pages\AppTitleIcon.png" />
    <Content Include="Pages\Home.aspx" />
    <Content Include="Pages\ImportLicense.aspx" />
    <Content Include="Pages\SPUtils.js" />
    <Content Include="Pages\ValidateLicense.aspx" />
    <Content Include="Service References\LicenseVerificationService\LicenseSPAppSampleWeb.LicenseVerificationService.VerifyEntitlementTokenResponse.datasource">
      <DependentUpon>Reference.svcmap</DependentUpon>
    </Content>
    <None Include="Service References\LicenseVerificationService\configuration91.svcinfo" />
    <None Include="Service References\LicenseVerificationService\configuration.svcinfo" />
    <None Include="Service References\LicenseVerificationService\Reference.svcmap">
      <Generator>WCF Proxy Generator</Generator>
      <LastGenOutput>Reference.cs</LastGenOutput>
    </None>
    <Content Include="Web.config" />
    <Content Include="Web.Debug.config">
      <DependentUpon>Web.config</DependentUpon>
    </Content>
    <Content Include="Web.Release.config">
      <DependentUpon>Web.config</DependentUpon>
    </Content>
    <Content Include="Service References\LicenseVerificationService\VerificationAgent1.wsdl" />
    <None Include="Service References\LicenseVerificationService\verificationagent4.xsd">
      <SubType>Designer</SubType>
    </None>
    <None Include="Service References\LicenseVerificationService\verificationagent41.xsd">
      <SubType>Designer</SubType>
    </None>
    <None Include="Service References\LicenseVerificationService\verificationagent42.xsd">
      <SubType>Designer</SubType>
    </None>
    <None Include="Service References\LicenseVerificationService\verificationagent43.xsd">
      <SubType>Designer</SubType>
    </None>
  </ItemGroup>
  <ItemGroup>
    <Compile Include="App_GlobalResources\LicensingResources.Designer.cs">
      <AutoGen>True</AutoGen>
      <DesignTime>True</DesignTime>
      <DependentUpon>LicensingResources.resx</DependentUpon>
    </Compile>
    <Compile Include="SPAppLicenseHelper.cs" />
    <Compile Include="Pages\Home.aspx.cs">
      <DependentUpon>Home.aspx</DependentUpon>
      <SubType>ASPXCodeBehind</SubType>
    </Compile>
    <Compile Include="Pages\Home.aspx.designer.cs">
      <DependentUpon>Home.aspx</DependentUpon>
    </Compile>
    <Compile Include="Pages\ImportLicense.aspx.cs">
      <DependentUpon>ImportLicense.aspx</DependentUpon>
      <SubType>ASPXCodeBehind</SubType>
    </Compile>
    <Compile Include="Pages\ImportLicense.aspx.designer.cs">
      <DependentUpon>ImportLicense.aspx</DependentUpon>
    </Compile>
    <Compile Include="Pages\ValidateLicense.aspx.cs">
      <DependentUpon>ValidateLicense.aspx</DependentUpon>
      <SubType>ASPXCodeBehind</SubType>
    </Compile>
    <Compile Include="Pages\ValidateLicense.aspx.designer.cs">
      <DependentUpon>ValidateLicense.aspx</DependentUpon>
    </Compile>
    <Compile Include="Properties\AssemblyInfo.cs" />
    <Compile Include="Service References\LicenseVerificationService\Reference.cs">
      <AutoGen>True</AutoGen>
      <DesignTime>True</DesignTime>
      <DependentUpon>Reference.svcmap</DependentUpon>
    </Compile>
    <Compile Include="TokenHelper.cs" />
  </ItemGroup>
  <ItemGroup>
    <WCFMetadata Include="Service References\" />
  </ItemGroup>
  <ItemGroup>
    <WCFMetadataStorage Include="Service References\LicenseVerificationService\" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="App_GlobalResources\LicensingResources.resx">
      <Generator>GlobalResourceProxyGenerator</Generator>
      <LastGenOutput>LicensingResources.Designer.cs</LastGenOutput>
    </Content>
  </ItemGroup>
  <PropertyGroup>
    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
    <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
  </PropertyGroup>
  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
  <Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
  <ProjectExtensions>
    <VisualStudio>
      <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
        <WebProjectProperties>
          <UseIIS>True</UseIIS>
          <AutoAssignPort>True</AutoAssignPort>
          <DevelopmentServerPort>0</DevelopmentServerPort>
          <DevelopmentServerVPath>/</DevelopmentServerVPath>
          <IISUrl>http://localhost:6109/</IISUrl>
          <NTLMAuthentication>False</NTLMAuthentication>
          <UseCustomServer>False</UseCustomServer>
          <CustomServerUrl>
          </CustomServerUrl>
          <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
        </WebProjectProperties>
      </FlavorProperties>
    </VisualStudio>
  </ProjectExtensions>
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>