IT tutorials
 
Applications Server
 

Sharepoint 2013 : Packaging and distributing apps (part 2) - Packaging apps - Packaging host web features, Packaging for autohosted apps

2/22/2014 2:38:22 AM
- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019

Packaging host web features

These two types of features are used to extend the user interface of the host web, as opposed to many of the other types of elements in an app that are added to the app web. For this reason, the XML files containing the definitions of client web parts and UI custom actions are not deployed within a solution package embedded within the app package. Instead, the XML files that define client web parts and UI custom actions are added to the app package as top-level files.

Consider an example SharePoint app named MyAppParts that contains two client web parts. The contents of the app package for this app will contain a top-level elements.xml file for each of the client web parts and a top-level feature.xml file for the feature that hosts them. When Visual Studio 2012 creates these XML files and builds them into the output app package file, it adds a unique GUID to each file name to avoid naming conflicts, as illustrated in Figure 2.

The feature that hosts client web parts and UI custom actions is a web-scoped feature known as a host web feature. The SharePoint host environment is able to detect a host web feature inside an app package during app installation and activate it in the host web. When an app with a web host feature is installed at tenancy scope, that feature will be activated in more than one site.

The XML files that define client web parts and UI custom actions are packaged as top-level files within the app package.

Figure 2. The XML files that define client web parts and UI custom actions are packaged as top-level files within the app package.

Packaging for autohosted apps

When it comes to packaging a SharePoint app for distribution, autohosted apps are more complicated and deserve a little extra attention. The extra complexity is required because the app package for an autohosted app must contain the resources required to create an ASP.NET application on demand to deploy the remote web. An autohosted app can also be designed to create a SQL Azure database, as well, during the app installation process.

When you create a new autohosted app, Visual Studio 2012 creates two projects. There is one project for the app itself and a second web project for an ASP.NET application to implement the remote web. For example, if you create a new autohosted app using the name MyAutoHostedApp, Visual Studio 2012 creates an app project named MyAutoHostedApp and an ASP.NET project named MyAutoHostedAppWeb, and adds them to a single Visual Studio solution.

What is important to understand is that the app package built for the MyAutoHostedApp project must contain all the necessary files to deploy the ASP.NET project named MyAutoHostedAppWeb. This is a requirement because the installation of this app package must provide the Office 365 environment with the means to provision the remote web as a Windows Azure application. This is what makes it possible for an autohosted app to create its own remote web during the installation process.

Visual Studio 2012 relies on a packaging format that Microsoft created especially for the Windows Azure environment by which all the files and metadata required to deploy an ASP.NET application are built in to a single zip file for distribution. This zip file is known as a web deploy package. When used within the SharePoint app model, the web deploy package is embedded within the app package of an autohosted app for distribution.

When Visual Studio 2012 builds the web deploy package for an autohosted app, it creates the file by combining the app package name together with a web.zip extension. For example, an app packaged named MyAutohostedApp.app will have an embedded web deploy package named MyAutohostedApp.web.zip.

Now, consider the scenario in which an autohosted app has an associated SQL Azure database. The Office 365 environment must create this database on demand during app installation. Therefore, the app package must contain the resources required to create a SQL Azure database containing standard database objects, such as tables, indexes, stored procedures, and triggers.

The SharePoint app packaging model takes advantage of a second packaging format that Microsoft created for Windows Azure known as a Data Tier Application package. In this packaging format, the metadata required to automate the creation of a SQL Azure database is defined in XML files that are built in to a zip file with an extension of .dacpac. The name of the Data Tier Application package is typically based on the name of the database. For example, a SQL Azure database named MySqlDatabase will have an associated Data Tier Application package named MySqlDatabase.dacpac. If you look inside a Data Tier Application package, you can locate a file named model.xml, which defines the database objects that need to be created.

Figure 3 shows the layout of an app package for an autohosted app that will trigger the Office 365 environment to create a remote and a SQL Azure database as part of the app installation process. Remember that the web deploy package is required in an autohosted app package, whereas the data tier application package is optional.

An autohosted app package contains a web deployment package to create the remote web and a data application package to create a SQL Azure database.

Figure 3. An autohosted app package contains a web deployment package to create the remote web and a data application package to create a SQL Azure database.

When you create an autohosted app, Visual Studio 2012 automatically creates the web project and takes care of setting up all that’s required to build the web deploy package into the app package. However, you have to take a few extra steps to create a SQL database project and configure it to properly build the Data Tier Application package in to the app package.

The first step is to create a new SQL database project in Visual Studio 2012 and add it to the same solution that contains the autohosted project. Next, on the Properties page of the SQL Database project, go to the Project Settings tab and change the target platform setting to SQL Azure. This is the step that changes the project output to a Data Tier Application package. After this, you must build the SQL database project at least once to build the Data Tier Application package.

The final step is to configure the app project to reference the Data Tier Application package. You can accomplish this by using the property sheet for the autohosted app project. You will find that there is a project property named SQL Package. Once you configure the SQL Package property to point to the Data Tier Application package (.dacpac) file, you have made the necessary changes so that Visual Studio 2012 will begin building the Data Tier Application package into app package file.

 
Others
 
- Sharepoint 2013 : Packaging and distributing apps (part 1) - Packaging apps - Understanding the app web solution package
- EXchange Server 2013 : Using and managing Exchange services (part 3) - Sample configuration for WinRM
- EXchange Server 2013 : Using and managing Exchange services (part 2) - Configuring service startup,Configuring service recovery
- EXchange Server 2013 : Using and managing Exchange services (part 1) - Working with Exchange services, Checking required services
- Microsoft Lync Server 2013 Edge Server : Edge Server Troubleshooting (part 3) - Lync Centralized Logging, Lync Server Management Shell, Telnet, Troubleshooting Lync Services
- Microsoft Lync Server 2013 Edge Server : Edge Server Troubleshooting (part 2) - DNS Records
- Microsoft Lync Server 2013 Edge Server : Edge Server Troubleshooting (part 1) - Certificates
- Sharepoint 2013 : Community portals and sites - Enabling site-wide reputation tracking
- Sharepoint 2013 : Community portals and sites - Assigning badges to members
- Sharepoint 2013 : Community portals and sites - Working with badges
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
Technology FAQ
- Is possible to just to use a wireless router to extend wireless access to wireless access points?
- Ruby - Insert Struct to MySql
- how to find my Symantec pcAnywhere serial number
- About direct X / Open GL issue
- How to determine eclipse version?
- What SAN cert Exchange 2010 for UM, OA?
- How do I populate a SQL Express table from Excel file?
- code for express check out with Paypal.
- Problem with Templated User Control
- ShellExecute SW_HIDE
programming4us programming4us