Praise for Smart Client Deployment with ClickOnce “ClickOnce demos may look simple, but those techniques only work for simple applications. Brian Noyes gives us the information we need to use ClickOnce in the real world, and he does it with a comprehensive and organized presenta- tion. If you expect your smart client application to move very far beyond ‘Hello, World,’ you’ll want this book to help you deploy it.” —Billy Hollis, president/owner, Elysian Consulting, Microsoft Regional Director “Once again Brian has outdone himself. As a writer, I tend to be very critical of all technical publications, including my own . . . and it is such a pleasure to read anything Brian writes because he studies his topics well, resulting in an accu- rate, thorough, yet concise piece of work. ClickOnce being a new technology that deals with the pains we all have with application deployment, versioning, and security, it is important to have a text that will guide you through the learn- ing process, give you sound advice for adopting the technology, and explain why you should even care. Brian gives his readers all of that.” —Michele Leroux Bustamante, chief architect, IDesign, Microsoft Regional Director “ClickOnce is the key to Windows and smart client deployment. Brian’s book is the key to successfully using ClickOnce. This book walks you through using ClickOnce, from the basics to advanced scenarios. It is an excellent resource.” —Rockford Lhotka, principal technology evangelist, Magenic Technologies, Microsoft Regional Director “Brian covers ClickOnce with a view to real-world deployment issues, which is obviously based on real-world experience. In and of itself, that is enough for me to buy the book. However, it is an even better investment by virtue of the fact that ClickOnce is a core part of the .NET Framework for Windows Forms 2.0 now, and Windows Presentation Foundation in the future.” —Michael Weinhardt, SDK programmer/writer, Application Model, Windows Presentation Foundation, Microsoft “This book covers the most important ingredient needed for the success of a smart client application—deployment. The author’s unassuming writing style, combined with his in-depth coverage of the topic, makes this book an invalu- able resource for all serious smart client developers.” —Vishwas Lele, principal architect, Applied Information Sciences, Microsoft Regional Director This page intentionally left blank Smart Client Deployment with ClickOnce Smart Client Deployment with ClickOnce Deploying Windows Forms Applications with ClickOnce Brian Noyes Upper Saddle River, NJ • Boston • Indianapolis • San Francisco New York • Toronto • Montreal • London • Munich • Paris • Madrid Capetown • Sydney • Tokyo • Singapore • Mexico City Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and the publisher was aware of a trademark claim, the designations have been printed with initial capital letters or in all capitals. The .NET logo is either a registered trademark or trademark of Microsoft Corporation in the United States and/or other countries and is used under license from Microsoft. The author and publisher have taken care in the preparation of this book, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for inciden- tal or consequential damages in connection with or arising out of the use of the information or programs con- tained herein. The publisher offers excellent discounts on this book when ordered in quantity for bulk purchases or special sales, which may include electronic versions and/or custom covers and content particular to your business, training goals, marketing focus, and branding interests. For more information, please contact: U.S. Corporate and Government Sales (800) 382-3419 [email protected] For sales outside the United States please contact: International Sales [email protected] Visit us on the Web: www.awprofessional.com Library of Congress Cataloging-in-Publication Data Noyes, Brian. Smart client deployment with ClickOnce : deploying Windows Forms applications with ClickOnce / Brian Noyes. p. cm. Includes index. ISBN 0-321-19769-0 (pbk. : alk. paper) 1. ClickOnce (Electronic resource) 2. Computer software—Development. 3. Microsoft Windows (Computer file) 4. Microsoft .NET. I. Title. QA76.76.D47N693 2007 005.3—dc22 2006035484 Copyright © 2007 Pearson Education, Inc. All rights reserved. Printed in the United States of America. This publication is protected by copyright, and permission must be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or like- wise. For information regarding permissions, write to: Pearson Education, Inc. Rights and Contracts Department 75 Arlington Street, Suite 300 Boston, MA 02116 Fax: (617) 848-7047 ISBN 0-321-19769-0 Text printed in the United States on recycled paper at Courier in Stoughton, Massachusetts. First printing, December 2006 To Robin, printed words can never convey how much I love you and treasure sharing every day with you. Thank you for your support and patience with my exceptional ability to over-commit myself to work. To Nathan, it is a joy to watch you grow and learn, and my heart swells just thinking about all the experiences we will share together over the coming years. This page intentionally left blank Contents Figures xv Foreword xxi Preface xxiii Acknowledgments xxxi About the Author xxxiii 1 Introduction to ClickOnce 1 What Is a Smart Client Application? 2 Smart Clients Are Rich Client Applications 3 Smart Clients Are Typically Distributed Applications 4 Smart Clients Run Securely on the Client Machine 4 Smart Clients Support Offline Operations 4 Smart Clients Are Automatically Network Deployed and Updated 6 Why Choose Smart Clients? 6 Smart Client Deployment Challenges 7 Design Goals of ClickOnce 8 ClickOnce Features 9 Terminology 10 ClickOnce Deployment Modes 12 ClickOnce Deployment Architecture 14 ClickOnce Deployment Process Overview 16 First ClickOnce Deployment: ClickOnce Hello World 17 Creating an Application to Deploy 18 Publishing the Application 18 ix