Creating Self-Updating Applications

Last post 12-14-2007 6:22 by Anonymous. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 10-11-2004 15:10

    Creating Self-Updating Applications

    Creating Self-Updating Applications With the .NET Compact Framework
    Alex Feinman
    OpenNETCF.org

    December, 2003

    Applies to:
    Microsoft® .NET Compact Framework 1.0
    Microsoft Visual Studio® .NET 2003

    Summary: Learn to create self-updating applications using .NET Compact Framework. (9 printed pages)
    ================================================================
    Regarding the above article on MSDN, I am having trouble getting this to work.
    I am writting the application in C# and I have no problems with the getting the app to check the MyApp Assembly for the version / build etc. However the problem I am having is not being able to call the web service successfully, I have followed the code exactly as I should but I am getting an exception error thrown in the web reference.cs file that VS.NET auto generates.

    Has anyone successfully gotten this app to work?

    I could really use the help.

    Note below is the exact point the app is throwing the webservices.dll
    exception.

    ================================

    //------------------------------------------------------------------------------
    // <autogenerated>
    // This code was generated by a tool.
    // Runtime Version: 1.1.4322.573
    //
    // Changes to this file may cause incorrect behavior and will be lost if
    // the code is regenerated.
    // </autogenerated>
    //------------------------------------------------------------------------------

    //
    // This source code was auto-generated by Microsoft.VSDesigner, Version 1.1.4322.573.
    //
    namespace Update.UpdateSrvc {
    using System.Diagnostics;
    using System.Xml.Serialization;
    using System;
    using System.Web.Services.Protocols;
    using System.ComponentModel;
    using System.Web.Services;


    /// <remarks/>
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Web.Services.WebServiceBindingAttribute(Name="updateSoap", Namespace="http://tempuri.org/")]
    public class update : System.Web.Services.Protocols.SoapHttpClientProtocol {

    /// <remarks/>
    public update() {
    this.Url = "http://localhost/srvUpdate/update.asmx";
    }

    /// <remarks/>
    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetUpdateInfo", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
    public UpdateInfo GetUpdateInfo(string name, string platform, string arch, int maj, int min, int bld) {
    object[] results = this.Invoke("GetUpdateInfo", new object[] {
    name,
    platform,
    arch,
    maj,
    min,
    bld});
    return ((UpdateInfo)(results[0])); ******//This is where my code is breaking. ********
    ***** for some reason it can't return the result of strings.



    }

    /// <remarks/>
    public System.IAsyncResult BeginGetUpdateInfo(string name, string platform, string arch, int maj, int min, int bld, System.AsyncCallback callback, object asyncState) {
    return this.BeginInvoke("GetUpdateInfo", new object[] {
    name,
    platform,
    arch,
    maj,
    min,
    bld}, callback, asyncState);
    }

    /// <remarks/>
    public UpdateInfo EndGetUpdateInfo(System.IAsyncResult asyncResult) {
    object[] results = this.EndInvoke(asyncResult);
    return ((UpdateInfo)(results[0]));
    }
    }

    /// <remarks/>
    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://tempuri.org/")]
    public class UpdateInfo {

    /// <remarks/>
    public string Url;

    /// <remarks/>
    public bool IsAvailable;

    /// <remarks/>
    public string newVersion;
    }
    }
    // end of file


    I'd appreciate any help on this.

    regards,
    Cam_MCAD
  • 11-22-2004 12:27 In reply to

    Re: Creating Self-Updating Applications

    hey, i was looking around at this sample too, so far i've gottent he server side of the sample working but working with the VB code sample i don't see anywhere in testapp where it's invoking the updater class and executing a call to the webservice function.

    i tried adding the updater project as a reference in testapp but get an error saying that the "assembly must have a 'dll' extension in order to be referenced".

    the problem is similar to cam_mcad except in VB.

    I can't seem to find if and when testapp is actually calling updater.
  • 04-27-2005 8:23 In reply to

    Re: Creating Self-Updating Applications

    quote:
    Originally posted by tzrrkah

    hey, i was looking around at this sample too, so far i've gottent he server side of the sample working but working with the VB code sample i don't see anywhere in testapp where it's invoking the updater class and executing a call to the webservice function.

    i tried adding the updater project as a reference in testapp but get an error saying that the "assembly must have a 'dll' extension in order to be referenced".

    the problem is similar to cam_mcad except in VB.

    I can't seem to find if and when testapp is actually calling updater.

  • 04-27-2005 8:24 In reply to

    Re: Creating Self-Updating Applications

    In fact in this solution you got 2 project: the testapp and the update. Also in the same folder of the solution you'll find the project for the Agent, you need to compile the Agent project too and this will create the dll needed for the Agent.

    TestAPP and Updater are 2 different projects. First deploy TestAPP on your PPC.
    In the updater project change the line:

    'Dim sPath As String = GetCurrentDirectory() + "\" + xmlConfig("updateinfo")("checkassembly").GetAttribute("name")

    by
    Dim sPath As String = "\Program Files\TestAPP" + "\" + xmlConfig("updateinfo")("checkassembly").GetAttribute("name")

    then don't forget to change information described in the #error section , DEPLOY it now and run it

    Francois
  • 12-14-2007 6:22 In reply to

    Re: Creating Self-Updating Applications

    Client: Pocket PC application (CF 1.0 - so it works on PPC2002, WM2003, WM2005 devices)
    Server: ASP.NET 1.1 WebService

    Everything works fine. But if I change the tempuri.org to something meaningful some(!) WebMethods fail with following error: Cannot find type for http://tempuri.org/:MyStuff

    The problem is located in CF! If I access the same WebService with a CommandLine application it will work! There is still tempuri.org somewhere at the CF side...

    Any ideas?
Page 1 of 1 (5 items)