ASP.NET Web Deployment Using Visual Studio Tom Dykstra

Total Page:16

File Type:pdf, Size:1020Kb

ASP.NET Web Deployment Using Visual Studio Tom Dykstra ASP.NET Web Deployment using Visual Studio Tom Dykstra Summary: This tutorial series shows you how to deploy (publish) an ASP.NET web application to a Windows Azure Web Site or a third-party hosting provider, by using Visual Studio 2012 or Visual Studio 2010. You develop a web application in order to make it available to people over the Internet. But web programming tutorials typically stop right after they've shown you how to get something working on your development computer. This tutorial begins where the others leave off: you've built a web site, tested it, and it's ready to go. What's next? This tutorial shows you how to deploy first to IIS on your local development computer for testing, and then to Windows Azure or a third- party hosting provider for staging and production. The sample application that you'll deploy is a web application project that uses the Entity Framework, SQL Server, and the ASP.NET membership system. The sample application uses ASP.NET Web Forms, but the procedures shown apply also to ASP.NET MVC and Web API. Category: Step-by-Step Applies to: ASP.NET, Visual Studio 2010, Visual Studio 2012, Windows Azure Source: ASP.NET Site (http://asp.net/web-forms/tutorials/deployment/visual-studio- web-deployment/introduction) E-book publication date: April, 2013 Copyright © 2013 by Microsoft Corporation All rights reserved. No part of the contents of this book may be reproduced or transmitted in any form or by any means without the written permission of the publisher. Microsoft and the trademarks listed at http://www.microsoft.com/about/legal/en/us/IntellectualProperty/Trademarks/EN-US.aspx are trademarks of the Microsoft group of companies. All other marks are property of their respective owners. The example companies, organizations, products, domain names, email addresses, logos, people, places, and events depicted herein are fictitious. No association with any real company, organization, product, domain name, email address, logo, person, place, or event is intended or should be inferred. This book expresses the author’s views and opinions. The information contained in this book is provided without any express, statutory, or implied warranties. Neither the authors, Microsoft Corporation, nor its resellers, or distributors will be held liable for any damages caused or alleged to be caused either directly or indirectly by this book. ASP.NET Web Deployment using Visual Studio Contents Introduction .................................................................................................................................................. 6 Overview ................................................................................................................................................... 6 Intended audience .................................................................................................................................... 6 Using a third-party hosting provider ......................................................................................................... 7 Deploying web site projects ...................................................................................................................... 7 Deploying ASP.NET MVC projects ............................................................................................................. 7 Programming language ............................................................................................................................. 7 Database deployment methods................................................................................................................ 7 Entity Framework Code First Migrations .............................................................................................. 8 The dbDacFx Web Deploy provider ...................................................................................................... 8 Troubleshooting during this tutorial ......................................................................................................... 9 Comments welcome ................................................................................................................................. 9 Prerequisites ............................................................................................................................................. 9 Download the sample application .......................................................................................................... 10 Review application features that affect deployment ............................................................................. 13 Summary ................................................................................................................................................. 14 Preparing for Database Deployment .......................................................................................................... 15 Overview ................................................................................................................................................. 15 SQL Server Express LocalDB .................................................................................................................... 15 Entity Framework and Universal Providers ............................................................................................ 15 Configure Code First Migrations for application database deployment ................................................ 16 Disable the initializer ........................................................................................................................... 18 Enable Code First Migrations .............................................................................................................. 18 Set up the Seed method ..................................................................................................................... 20 Create scripts for membership database deployment ........................................................................... 23 Summary ................................................................................................................................................. 33 More Information ................................................................................................................................... 34 1 Web.config File Transformations ................................................................................................................ 35 Overview ................................................................................................................................................. 35 Web.config transformations versus Web Deploy parameters ............................................................... 35 Default transformation files .................................................................................................................... 35 Disable debug mode ............................................................................................................................... 36 Limit error log access to administrators ................................................................................................. 37 A setting that you'll handle in publish profile transformation files ........................................................ 42 Setting connection strings ...................................................................................................................... 43 Summary ................................................................................................................................................. 43 More Information ................................................................................................................................... 44 Project Properties ....................................................................................................................................... 45 Overview ................................................................................................................................................. 45 Configure deployment settings in the project properties window ........................................................ 45 Make sure that the Elmah folder gets deployed .................................................................................... 47 Summary ................................................................................................................................................. 48 Deploying to Test ........................................................................................................................................ 49 Overview ................................................................................................................................................. 49 Install IIS .................................................................................................................................................. 49 Install SQL Server Express ....................................................................................................................... 53 Create SQL Server Express databases for the test environment ............................................................ 53 Create a grant script for the new databases........................................................................................... 55 Run the grant script in the application database .................................................................................... 56 Publish
Recommended publications
  • Full Stack Flex Program Curriculum Overview
    THE CODING BOOT CAMP FULL STACK FLEX PROGRAM CURRICULUM OVERVIEW The digital revolution has transformed virtually every area of human activity—and you can be part of it as a web development professional. The Coding Boot Camp is a part- time, 24-week Full Stack Flex course that gives you the knowledge and skills to build dynamic end-to-end web applications and become a full stack web developer. Courses are scheduled to fit into your life, whether you’re employed or attending college full-time, with convenient weekend and evening sessions. The program is rigorous and fast-paced and covers both the theory and application of web development. As you gain proficiency, you’ll use what you learn on real projects under the guidance of area employers. Plus, you’ll have an impressive Professional Portfolio and the confidence to succeed as a web development professional. © University of Denver Coding Boot Camp - In collaboration with Trilogy Education Services PAGE 1 © University of Denver Coding Boot Camp - In collaboration with Trilogy Education Services IS THE PROGRAM RIGHT FOR YOU? Are you creative, curious and looking to reinvent yourself professionally? If so—or if any of the following describes your situation—enrolling in our coding boot camp could be a smart career move: » You’re considering a career change but not sure how to take the first step. » You’re happy in your current field, but want to move to another company—or stay put but shift from a non-technical into a technical position. » You want to engage more deeply with your current job—or boost your earnings and broaden your experience with freelance work.
    [Show full text]
  • Building Openjfx
    Building OpenJFX Building a UI toolkit for many different platforms is a complex and challenging endeavor. It requires platform specific tools such as C compilers as well as portable tools like Gradle and the JDK. Which tools must be installed differs from platform to platform. While the OpenJFX build system was designed to remove as many build hurdles as possible, it is necessary to build native code and have the requisite compilers and toolchains installed. On Mac and Linux this is fairly easy, but setting up Windows is more difficult. If you are looking for instructions to build FX for JDK 8uNNN, they have been archived here. Before you start Platform Prerequisites Windows Missing paths issue Mac Linux Ubuntu 18.04 Ubuntu 20.04 Oracle Enterprise Linux 7 and Fedora 21 CentOS 8 Common Prerequisites OpenJDK Git Gradle Ant Environment Variables Getting the Sources Using Gradle on The Command Line Build and Test Platform Builds NOTE: cross-build support is currently untested in the mainline jfx-dev/rt repo Customizing the Build Testing Running system tests with Robot Testing with JDK 9 or JDK 10 Integration with OpenJDK Understanding a JDK Modular world in our developer build Adding new packages in a modular world First Step - development Second Step - cleanup Before you start Do you really want to build OpenJFX? We would like you to, but the latest stable build is already available on the JavaFX website, and JavaFX 8 is bundled by default in Oracle JDK 8 (9 and 10 also included JavaFX, but were superseded by 11, which does not).
    [Show full text]
  • Ironpython in Action
    IronPytho IN ACTION Michael J. Foord Christian Muirhead FOREWORD BY JIM HUGUNIN MANNING IronPython in Action Download at Boykma.Com Licensed to Deborah Christiansen <pedbro@gmail.com> Download at Boykma.Com Licensed to Deborah Christiansen <pedbro@gmail.com> IronPython in Action MICHAEL J. FOORD CHRISTIAN MUIRHEAD MANNING Greenwich (74° w. long.) Download at Boykma.Com Licensed to Deborah Christiansen <pedbro@gmail.com> For online information and ordering of this and other Manning books, please visit www.manning.com. The publisher offers discounts on this book when ordered in quantity. For more information, please contact Special Sales Department Manning Publications Co. Sound View Court 3B fax: (609) 877-8256 Greenwich, CT 06830 email: orders@manning.com ©2009 by Manning Publications Co. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by means electronic, mechanical, photocopying, or otherwise, without prior written permission of the publisher. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in the book, and Manning Publications was aware of a trademark claim, the designations have been printed in initial caps or all caps. Recognizing the importance of preserving what has been written, it is Manning’s policy to have the books we publish printed on acid-free paper, and we exert our best efforts to that end. Recognizing also our responsibility to conserve the resources of our planet, Manning books are printed on paper that is at least 15% recycled and processed without the use of elemental chlorine.
    [Show full text]
  • Salesware Installation Guide Version 4.4
    Salesware Installation Guide Version 4.4 accesso 302 Camino de la Placita Taos, NM 87571 575.751.0633 www.accesso.com Copyright Copyright 2015 accesso Technology Group, plc. All rights reserved. NOTICE: All information contained herein is the property of accesso Technology Group, plc. No part of this publication (whether in hardcopy or electronic form) may be reproduced or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written consent of accesso Technology Group, plc. The software, which includes information contained in any databases, described in this document is furnished under a license agreement and may be used or copied only in accordance with the terms of that agreement. This publication and the information herein is furnished AS IS, is subject to change without notice, and should not be construed as a commitment by accesso Technology Group, plc. accesso Technology Group, plc. assumes no responsibility or liability for any errors or inaccuracies, makes no warranty of any kind (express, implied, or statutory) with respect to this publication, and expressly disclaims any and all warranties of merchantability, fitness for particular purposes, and non-infringement of third party rights. Installation overview ............................................................................................................................................ 2 Installation of core Salesware modules .............................................................................................................
    [Show full text]
  • Web Developer (Jquery, CSS)
    Position Title: Web Developer (jQuery, CSS) Location: Denver, CO Compensation: Salary based on experience Company National Valuation Consultants, Inc. (NVC) is the largest privately held, commercial real estate valuation and consulting company in the United States, with offices in Denver, Morristown, Cincinnati, Atlanta, Chicago and Tampa. The Denver corporate headquarters office is currently seeking a fulltime Web Developer (jQuery, CSS). NVC’s Core Values Our core values make us who we are. As we change and grow, the beliefs that are most important to us stay the same—putting people first, pursuing excellence, acting with integrity and serving our world. We only hire candidates who are aligned with these values. For additional information about NVC, please visit the company website at: www.nvcinc.com. Duties Include: Construct, develop and maintain Web applications using a combination of HTML5, CSS including Bootstrap and JavaScript including jQuery. Develop APIs to communicate with the back end. Job Requirements: Bachelor's degree or greater in Information Systems, Computer Science or related concentration and/or two or more years of relevant experience in a corporate environment. Mastery of front end development skills such as HTML5, CSS3, JavaScript, and jQuery Experience in building and owning enterprise level front end and user interface code for large scale web applications Deep understanding of front end engineering principles and experience with front end technologies and frameworks Experience working with Back End engineering to integrate into the full product stack Required JS Skills: Excellent coding experience in JavaScript Working knowledge of jQuery Bootstrap and Responsive design techniques Browser compatibility issues Services-Oriented Architecture HTTP and RESTful services AngularJS, Knockout, or equivalent JS MVC and/or AMD frameworks Use best practices to document and write quality software.
    [Show full text]
  • Tutorial #1: Getting Started with ASP.NET
    Tutorial #1: Getting Started with ASP.NET This is the first of a series of tutorials that will teach you how to build useful, real- world websites with dynamic content in a fun and easy way, using ASP.NET and C#. ASP.NET pages can display HTML, collect user input, and interact with databases. Note that these tutorials are not meant to provide an in-depth training in ASP.NET programming. The goal is to walk you through the development steps of a simple project, which you may later follow in designing an interface to your own final database project for this class. If you are interested in further study of web development with ASP.NET, I recommend the book by Scott Mitchell, SAMS Teach Yourself ASP.Net in 24 Hours, Pearson Education, 2010, ISBN 978-0-672-33305-7. Step 1. Installing the Software Environment Prior to using ASP.NET, you will need to install the following software: • SQL Server 2008 R2 for the database engine. • SQL Server Management Studio Express for the client (SSMS) • Visual Web Developer Express 2010 for the IDE • The .NET framework 4 environment To install this software, visit the following website: http://www.microsoft.com/express/Downloads/ Click on Download then scroll down to 2010 Express products and click on Visual Web Developer 2010 Express. Because Visual Web Developer is designed for developing ASP.NET websites, installing it automatically installs the .NET Framework and other required ASP.NET tools. You can also optionally install SQL Server 2008 (just checkmark “Microsoft SQL Server 2008 Express Service Pack 1” when prompted).
    [Show full text]
  • Ideablade Devforce Installation Guide
    DevForceDevForce Silverlight WinClient Installation Guide DevForce Silverlight Installation Guide Table of Contents Table of Contents Preface ................................................................................................................................ 1 Installation .......................................................................................................................... 2 Product Prerequisites ........................................................................................................................... 2 Pre-installation Checklist ...................................................................................................................... 2 Installing DevForce Silverlight .............................................................................................................. 4 Post-Installation Tasks ......................................................................................................................... 6 Updating Existing Applications....................................................................................... 7 Consult the Release Notes ................................................................................................................... 7 Upgrading DevForce Versions.............................................................................................................. 7 Upgrading DevForce Editions ............................................................................................................. 11 Troubleshooting
    [Show full text]
  • Websydian Web Developer
    Websydian Web Developer THE WEB DEVELOPMENT TOOL FOR CA PLEX Web Developer provides the software patterns required for managing the challenges of browser-based development including user and session management, data integrity protection, and user access control. Also included are abstract solutions for typical data manipulation scenarios, complete separation between application appearance and functionality. Web Developer contains WebsydianExpress , which is a platform providing a running web site out-of-the-box. This web site comes with support for multiple language sites and a browser-based administration interface enabling maintenance by none-developers and facilitating quick and secure prototyping of new business processes using CA Plex with Websydian, CA 2E or RPG. COPORATE DEVELOPERS TAKE OVER WEB DEVELOPMENT To enable transfer of back-end development resources to web, Web Developer provides an integrated environment making it possible to build web applications integrated with back- end processes and databases using only a single set of development skills. FOCUS ON BUSINESS PROCESSES INSTEAD OF TECHNOLOGY Web Developer allows you to stay focused on business processes by isolating the "technical plumbing", i.e. HTML syntax details, communication protocols, database management, implementation language issues and the like. SEPARATION OF APPLICATION FUNCTIONALITY FROM VISUAL DESIGN The visual web design is independent of the functionality of the application. Outsourcing of the web design therefore poses no risk on application or production data, and the web designer can work simultaneously with you on the web application. WEB APPLICATIONS INDEPENDENT OF PLATFORM AND WEB SERVER SOFTWARE Websydian web applications are platform and web server independent. Should the need arise to transfer an implemented solution from one platform to another, you can do this without any application re-development.
    [Show full text]
  • Billquick-SQL Server 2012 Express Installation Guide
    INSTALLATION GUIDE BillQuick-SQL Server 2012 Express Installation BillQuick-SQL Server 2012 Express Installation BillQuick | Power Up Your Business (866) 945-1595 | www.bqe.com | info@bqe.com INSTALLATION GUIDE BillQuick-SQL Server 2012 Express Installation CONTENTS SQL EXPRESS INSTALLATION 1 SYSTEM REQUIREMENTS 1 INSTALLING SQL 2012 EXPRESS 1 SQL EXPRESS CONFIGURATION 8 BILLQUICK DATABASE 11 BillQuick | Power Up Your Business (866) 945-1595 | www.bqe.com | info@bqe.com INSTALLATION GUIDE BillQuick-SQL Server 2012 Express Installation SQL EXPRESS INSTALLATION The Microsoft® SQL Server® 2012 Express software is the database engine you will use to store and report on data in BillQuick (Basic, Pro and Enterprise editions). It is available free from Microsoft and is a replacement for MSDE and SQL 2005. We do not recommend using SQL Server 2005 that might be installed with your Windows Server because other software programs that rely on that SQL Server instance can break if you attempt to install service pack updates on them. System Requirements You can check Microsoft Download Center to download Microsoft SQL Server 2012 R2 SP2. Click to know about the system requirements and installation instructions. Hardware/Software Requirements To know about the hardware and software requirements, go to Microsoft Developer Network . Installing SQL 2012 Express Please follow the steps below to install SQL Server 2012 Express edition. If you prefer, click here to watch a video on installing SQL Server Express. 1. Download the appropriate SQL Server 2012 Express setup to your desktop. Express Version System Microsoft® SQL Server® 2012 Express SP1 For 32-Bit machines, download the file: SQLEXPRWT_x86_ENU.exe For 64-Bit machines, download the file: SQLEXPRWT_x64_ENU.exe 2.
    [Show full text]
  • SQL Server Express: Setting up for Unistream User Guide 3/17
    Headquarters Unitronics (1989) (R"G). Unitronics Building, Airport City P.O.B. 300, Ben Gurion Airport, Israel 70100 Tel: + 972 (3) 977 8888 Fax: + 972 (3) 977 8877 SQL Server Express: Setting up for UniStream User Guide 3/17 Contents SQL Server Express: Setting up for UniStream ...................................................... 1 Overview ....................................................................................................... 1 Supported Controllers ...................................................................................... 1 First-time Installation & Configuration ................................................................. 2 Download ...................................................................................................... 2 Installing SQL Server ...................................................................................... 3 Setting up the Local Database .......................................................................... 5 Configuring SQL Server ................................................................................... 6 Activating the SQL Server Browser. ................................................................ 6 Enable TCP/IP, Assign Port ............................................................................ 7 Create a new Login ....................................................................................... 8 SQL Server Express—Existing Installation ........................................................... 10 Enable TCP/IP, Assign Port
    [Show full text]
  • CHAPTER 3 - DEVELOPER TOOLS for SHAREPOINT 2013 by Paul Swider, Reza Alirezaei, Brendon Schwartz, Matt Ranlett, Scot Hillier, Jeff Fried & Brian Wilson
    PROFESSIONAL SHAREPOINT 2013 DEVELOPMENT CHAPTER 3 - DEVELOPER TOOLS FOR SHAREPOINT 2013 by Paul Swider, Reza Alirezaei, Brendon Schwartz, Matt Ranlett, Scot Hillier, Jeff Fried & Brian Wilson IN THIS CHAPTER YOU WILL: • Understand the different tools available to SharePoint developers • Explore what’s new in SharePoint Designer 2013 • Learn how to use the new SharePoint tools in Visual Studio 3 Developer Tools for SharePoint 2013 WHAT’S IN THIS CHAPTER? ➤ Understanding the diff erent tools available to SharePoint developers ➤ Exploring what’s new in SharePoint Designer 2013 ➤ Using the new SharePoint tools in Visual Studio SharePoint has become one of the most developed-on platforms over the last decade, and Microsoft has invested in the developer experience with every release of SharePoint. SharePoint 2013 continues to improve the tools available for developers such as Visual Studio and SharePoint Designer while making tremendous strides with the addition of apps, Offi ce 365, and Microsoft Offi ce development. The addition of apps in SharePoint 2013 is a drastic change along with using familiar programming web standards such as HTML, CSS, JavaScript, OData, REST, and OAuth. The developer tools have included this support as well with full support for development against the cloud platforms. If you have used SharePoint 2010, you will see that many of the same project fi les are available, but there are new addi- tions to the array of items you can now use. The development tools are more integrated with the platform; debugging is easier in complex scenarios such as the web and more; and new tooling containing designers and templates was added so that you can easily work on SharePoint and transition to another web-based frame- work.
    [Show full text]
  • Chapter 1 Web Basics and Overview
    Chapter 1 Web Basics and Overview The Web is an Internet-based distributed information system. Anyone with a computer connected to the Internet can easily retrieve information by giving a Web address or by simply clicking a mouse button. The Web is a great way to disseminate information and making it available 24/7. Information can also be collected from Web users and customers through online forms. Maintainers and administrators can control and update Web content from anywhere on the Web. All these make the Web a powerful tool for mass communication, e-business and e-commerce. Compared with TV, radio, news papers, and magazines, putting the word out on the Web is relatively simple and inexpensive. But a website is much more than such one-way communication media. It can be a virtual o±ce or store that is always open and supported by workers from anywhere. Web service companies o®er free Web space and tools to generate simple personal or even business Web pages. But, well-designed and professionally implemented websites are much more involved. Even then, expertly produced websites are still much more cost-e®ective than other means of mass communication. For business and commerce, the cost of a website is negligible when compared to building and operating a brick-and-mortar o±ce or store. Once in-place, a website is a store that never closes and that is very attractive. People take great pains in building an o±ce or store to project the right image and to serve the needs 7 8 CHAPTER 1.
    [Show full text]