Fast Deploy Visual Studio Extension for SharePoint 2013 App Model
To increase my productivity and to keep me from going crazy I decided to create a VS2012 command extension to deploy single files to an existing SharePoint 2013 hosted app. This enables me to make quick changes without having to set everything back up and/or run in debug mode. You can get the extension here SPFastDeploy in the Visual Studio Gallery or just search for it under SharePoint 2013 in Visual Studio from the start page and “Discover extensions, add-ons, and samples”. After downloading it just click on the VSIX file and it will install itself. You can see it under Tools –> Extensions and Updates
Initially the Fast Deploy extension will show up in the tools menu. You can click on it and it will deploy the file that is in the current code window.
You can make it easier to use the extension by adding it to the project item context menu, so it will be visible when you right click on a file in your solution explorer. Do this by clicking on the VS tool bar drop down menu and selecting “Customize…”. Here select the “Context Menu” option and select the “Project and Solution Context Menus|Item”. Select the “Add Command” button, then select the “Tools” category and find the “Fast deploy to SP App” command and click OK.
Once you have done this you can use the extension from the context menu. Right clicking on any file will execute the code and deploy the file to the appropriate folder in your hosted app. A status message is displayed during and after the deployment. The code constructs a non-host header URL to the site where your application is hosted. It then uses the client object model to obtain the actual host header URL to the application. The host header URL is required when using the System.Net.WebClient to upload the file.
Productive app development
Visual Studio extensions are a great way to increase your productivity as a developer. The Fast Deploy extension lets me make minor changes and quickly upload them to my application without having to provision another application. This is especially useful if your applications are just using java script, html and css. No longer do I have to add my client web part on every change or provision my test data. This extension can only be used with SharePoint 2013 hosted apps. It could possibly be extended to be used with auto-hosted applications. Ideas are welcome. A codeplex project may be in the future for this.