Lost Password? No account yet? Register
Member Area

Software Installation Technologies

May 17th

Home arrow Community arrow External Blogs arrow ClickOnce

ClickOnce
Saurabh Pant's Weblog
My ramblings on .NET ...

  • .NET Framework 3.5 - Client Application Services

    I wrote the blog post below about 6 months back and just realised that I never actually got around to posting it. I the spirit of 'better late than never' here it is ... 

     .NET Framework 3.5 - Client Application Services

    In .NET Framework 3.5, ASP.NET provides built in Web Application Services that provide access to features such as forms authentication, roles, and profile properties. These services provide building blocks to enable super-common scenarios and as a result can provide significant productivity wins and time-savings for developers.

    The Client Application Services feature enables the Client developers to seamlessly leverage these Web Application Services from within their Client Applications. The feature also supports Occasionally Connect scenarios, enabling connected client applications to continue working even on loss of connectivity.

    clip_image002

    Consider the following scenario facilitated by this feature ?

    An enterprise leverages .NET 3.5 and exposes Authentication, Roles and Profile Application Services from their existing web servers. The enterprise has a mixture of Ajax, Silverlight and Rich Client applications, all of which are used by a typical employee on daily basis. The employee can now use one set of credentials to logon to all these applications and any preferences/settings modified at one location are reflects for all applications.  When the employee is away from the corporate network, say on a flight, she can still continues to use her Client Application by logging on in the offline mode using the same credentials. Also, say an employee gets promoted to be a manager, all the enterprise needs to do is add her to the manager role on the server and now managerial data is available to her across all her web and client applications.

    The heavy lifting involved in enabling the scenario above today lies in the underlying plumbing code; With Client Application Services in .NET 3.5 this plumbing is now taken care of by the framework itself, significantly boosting developer productivity.

    Let?s walk through a scenario and see how easy it is to now add Web Settings support to your application - 

    Part 1: Create the web site ?

    1. In Orcas Beta2, Create a new ASP.NET Web Application

    2. Set the authentication mode to Windows Authentication

    <authentication mode="windows"/>

    3. Fill in the profile section of the web.config. 

    <profile enabled="true">

    <properties>

    <add name="Text" type="string" readOnly="false" defaultValue="DefaultText" serializeAs="String" allowAnonymous="false"/>

    <add name="Color" type="string" readOnly="false" defaultValue="white" serializeAs="String" allowAnonymous="false" />

    </properties>

    </profile>

    4. Enable this property to be accessed via web services by adding this section to Web Config

    <system.web.extensions>

    <scripting>

                                    <webServices>

    <profileService enabled="true" readAccessProperties="Text, Color" writeAccessProperties="Text, Color"/>

    Part 2: Create the Client Application ?

    1. Right click on the solution and add a new project (works the same for WPF or WinForms)

    2. Right click on the new client project and select properties

    3. In the Services tab, enable application services, select windows auth and fill in the services url for the Web Settings Service. For now it is the development server URL, in production this would be your ASP.NET web site.

    clip_image004

    4. In the settings tab, click on ?Load Web Settings? ... this will pull down all the metadata for the profile properties defined on the server for the Windows User you are currently working as. ( If you were using Forms Authentication in your Application you would be prompted by the designer to enter you Forms Credentials before being able to download the settings meta data)

    clip_image006

    We are now ready to go!  We can have strongly typed, async read-write access to your Web settings.  These settings will stay in sync no matter where you change them (WinForms/WPF/Asp.Net/AJAX/Silverlight Application), they are reflected everywhere!

    Examples:

    Windows Forms code ?

    private void Form1_Load(object sender, EventArgs e)

            {

                BackColor = Color.FromName(Properties.Settings.Default.Color);

            }

            private void button1_Click(object sender, EventArgs e)

            {

                Properties.Settings.Default.Color = this.textBox1.Text;  

                BackColor = Color.FromName(Properties.Settings.Default.Color);

                Properties.Settings.Default.Save();

            }

    clip_image008

    ASP.NET Server side code ?

    function loadColor()

                    {                             

                                    Sys.Services.ProfileService.load(["Color"], loadCompleteCallback, loadSaveFailed, "");                                  

                    }

                    function btnSaveColor()

                    {

                                    Sys.Services.ProfileService.properties["Color"] = document.form1.theColor.value;

                                    Sys.Services.ProfileService.save(null, saveCompleteCallback, loadSaveFailed, "");

                    }

    clip_image010

    Source Code:

    The attached sample code contains the above Client scenario enabled with additional Forms Authentication (Login/Logout), Roles and Offline support.

    It also contains a Web Site with using the same Authentication and Profile service.

    Additional Resources:

    Web Application Services Overview ?

    http://msdn2.microsoft.com/en-us/library/bb547119(VS.90).aspx#Examples

    Client Application Services Overview ?

    http://msdn2.microsoft.com/en-us/library/bb384339(VS.90).aspx

    Client Application Services end to end walkthrough ?

    http://blogs.msdn.com/winformsue/archive/2007/05/20/client-application-services-in-windows-forms-end-to-end-walkthrough-available.aspx



  • VS Live 2008 Orlando - Silverlight 2 Talk

    Later today, I present @ VS Live the following talk ...

    Building Rich Internet Application using Microsoft Silverlight 2.0
    In this session, we will build a Video Search Web Site using Silverlight 2.0. The session will demo ? how to use Visual Studio to create a Sliverlight applications, how to create UI using XAML markup and code, how to retrieve data from a web service, how to manipulate  data with XML and LINQ, how to persist user settings using local storage, how to interact with browser using HTML DOM, how to use the SL OpenFile dialog etc ?

    Attached are the Source code/Presentaion/DemoScript for the talk .

    Guthrie?s Silverlight Tips, Tricks, Tutorials and Links Page are available here

    The MIX sessions I referred to are available online here.  

    In particular, the talk above was modeled after Joe Stegman and Mike Harsh's MIX 08 session of the same name, the code for which is availabe here.

    The UX Skin that I demoed was created by Corrina and she has bloged about it here.

    The page demoing the Silverlight 2 Beta 1 controls is available here

    Enjoy !!!



  • Avanade Tech Summit - Silverlight Talk

    I am presenting at the Avanade Tech Summit in Seattle today on "Building a Rich Internet Application using Silverlight 2.0". Slides for the presentaion are attached to this post ...

    The App I plan to build on stage is the same one Joe Stegman and Mike Harsh built during their MIX 08 session of the same name, and the code for which is availabe here.

     



  • Smart Client: Whats new in Orcas?

    Am presenting the following talk at DevConnections today -

    VMS311: Smart Clients: What's New in Visual Studio "Orcas"?
    Saurabh Pant
    Visual Studio "Orcas" is about making the rapid application development experience even easier. In this overview we will introduce new features that allow Smart Clients to go where they never have before: including Occasionally Connected Systems, SQL Server Compact Edition, Client App Services, N-Tier Data, ClickOnce Deployment enhancements, as well as out-of-the-box ways to future proof your existing applications: including Windows Forms / WPF Integration, and Vista enhancements. Add to that the designer productivity enhancements and see an exciting new wave of smart client development.  

    If you were at the session the side deck is attached to this post as promised.

    As always feedback/thoughts are welcome. Feel free to contact me through this blog is you would like additional information on any of the technologies discussed. 



  • Live From Redmond: Client Application Services in Orcas

    [Update] 

    Have attached the slide deck from the talk. The actual presentation can be viewed online at any time through the registration link below.

     

    [Original Post] 

    Continuing further along in with our "Live from Redmond" series I shall be presenting the following talk on Nov 27th ...

    Live From Redmond: Client Application Services in Orcas   

    27th Nov 2006 [Click here to register

    Client Application Services are a new set of features in Orcas that enable application to authenticate users, get roles for the user and persisting user settings on a server. These Client Application Services work in conjugation with the Web Application Services for Authentication, Roles and Profiles also new in Orcas. Additionally these Client Application Services support Occasionally Connected Applications by supporting offline Authenticatoin, Roles and Profiles, where they work against a local cache instead of an online server.

    This webcast will provide an introduction Client Application Services as well as examples of how to use the services in you own applications.



  • Live From Redmond: Configuring ClickOnce to best work for your deployment scenario

    [Update 11/27] 

    The talk is now available online here [Click here for zipped download]

     

    [Update 11/07]

    Attaching the Slide Deck from the presentation to the post.

     

     

    [Original Post]

    Continuing with our highly popular "Live from Redmond" series I shall be presenting the following ClickOnce talk on Nov 7th ...

    Live From Redmond: Configuring ClickOnce to best work for your deployment scenario   

    7th Nov 2006 [Click here to register

    The ?ClickOnce? feature in .Net 2.0 brings the ease of web deployment and update to Smart Client Applications in an enterprise. 

    Are you an enterprise developing Line Of Business applications inhouse and want to know how best to deploy them internally using ClickOnce?

    Are you a vendor and want to know how best to package your applications using ClickOnce so that they can be deployed by multiple enterprises?

    Is the cross browser support important to your application and you want to know what ClickOnce offers in this space?

    This webcast will discuss recommendations from the ClickOnce team on how ot best leverage ClickOnce for common deployment scenarios like above.

    It will discuss the options available with the current release of ClickOnce and how these scenarios are even better enabled in Orcas.



  • Live From Redmond series - Talk Resources

    An Overview of Windows Forms in Microsoft Visual Studio 2005

    For all the folks that logged into my MSDN talk today morning here is the slide deck from the talk. The talk being demo intensive the deck might not be super helpful but it does have the resources slide which will direct you to where you can get the samples I displayed during the talk.

    I'll also update this post as soon as we have the talk posted online ...



  • Upcoming team webcasts - Live From Redmond series

    As part of the Live From Redmond Series of talks I shall be presenting a talk on Aug 23rd -

    "An Overview of Windows Forms in Microsoft Visual Studio 2005".

    Windows Forms application development takes a giant step forward in Visual Studio 2005. This session provides an overview of the new Windows Forms feature set, as well as explores the RAD development environment. See how ClickOnce deployment technology brings the ease of Web deployment to Windows Forms applications. See demonstrations of how Windows Forms and Visual Studio 2005 make it easy to build professional looking applications. Walk through improvements to the Windows Forms designers, including demonstrations of snap lines and smart tags. This session also give a quick high level demonstration of how easy it is to build Office applications that use Windows Forms components.

    For client developers here is a list of all upcoming webcasts (see left pane of the Windows Forms website here for the more detailed list):

    Date

    Title

    Speaker

    Registration URL

    16-Aug

    Smart Client: Offline Data Synchronization and Caching for Smart Clients

    Steve Lasker

    Click here

    23-Aug

    Windows Forms: An Overview of Windows Forms in Microsoft Visual Studio 2005

    Saurabh Pant

    Click here

    30-Aug

    Visual Studio: Developing Local and Mobile Data Solutions with SQL Server Everywhere

    Steve Lasker

    Click here

    13-Sep

    (WinFX) Windows Forms: How to Leverage Windows Forms and Windows Presentation Foundation in a Single Hybrid Application

    Scott Morrison

    Click here

    20-Sep

    Windows Forms: Solutions to the Most Common Windows Forms Development Challenges

    Scott Morrison

    Click here



  • TechEd 2006

    [Update]
    Have attached the TechEd Slide Deck. The resources section for the deck will alos direct you to the sample code that I demoed during the presentation.

    [Original Post]
    Am in Boston this week for TechEd ... and just got done with my talk titled "Windows Forms in Visual Studio 2005: An Overview".
    I had planned to post the slide deck, demos, resources from the talk posted on my blog but have been having connectivity issues getting to WindowsForms.net server that hosts by blog files. Will have them uploaded by end of week at the latest ...

    Also I will be at the Technical Learning Centre - Dev Discussion Area on Wednesday 12:00-3:00 and Friday 9:00-4:00. If you happen to be at TechEd and have WindowsForms/ClickOnce questions feel free to stop by.



  • ClickOnce coverage in the 'Windows Forms User Education' team blog

    Jay Allen of the Windows Forms User Education team has some good coverage of ClickOnce issues on their team blog. Definately worth checking out ...

    http://blogs.msdn.com/winformsue/archive/category/11821.aspx




Visitors: 501120

Extended Menu