No-Touch deployment - IEExec - Duplicate Entries in Assembly Cache - Strongly Typed Datasets - InvalidCastException

From: Paul Linhardt (linhardt_at_aol.com)
Date: 04/23/04

  • Next message: Eric: "Strange ComboBox Behavior"
    Date: 23 Apr 2004 13:27:04 -0700
    
    

    I've been struggling with a problem using No-Touch Deployment for 10
    days now. Searching the newsgroups, I can see that people have been
    experiencing parts of the problem, but I haven't seen any posts about
    my particular circumstances.

    I have a client/server database application. Both Client & Server are
    running .NET Framework 1.1.4322. The client is a VB.NET winform
    application. On the server, I run a VB.NET Web Service that accesses
    a MS ACCESS database and returns Strongly Typed Datasets (STD). The
    Web Service uses the SOAP serializer to convert the STDs into XML
    (Marshal By Object) and my VB client app converts the returned SOAP
    messages back from XML to STD objects. So far, so good.

    My client/server application works perfectly and is humming along
    until one day my boss suggests that wouldn't it be good if we
    distributed the client application using No-Touch Deployment. I place
    the client app on the server and run it from within Internet Explorer.
     I start getting Exceptions when I run the client app:
    "System.InvalidCastException: Specified cast is not valid".

    The exceptions happen only with Web Service methods that return
    Strongly Typed Datasets (Web Service methods that return untyped
    Datasets or other types of data work fine).

    Every now and again, I compile a version of my client app that works.
    If I recompile again with no changes, the new version doesn't work. A
    version of myClientApp.exe that works once, always works. A version
    that doesn't work, I can usually eventually get working eventually by
    emptying various caches, restarting the server, etc. Once I get the
    .exe working once, it continues to work. I conclude that it's not my
    code that is the problem, but something about the assembly &
    versioning.

    Following various suggestions on newsgroups:

    (1) I set the version number manually in AssemblyInfo.vb so it is not
    automatically incremented with each compile
        <Assembly: AssemblyVersion("0.0.1.2")>

    (2) I set the http channel in the Web Service to make sure the SOAP
    serialization is on:
      <channel ref="http">
            <serverProviders>
                    <provider ref="wsdl" />
                    <formatter ref="soap" typeFilterLevel="Full" />
                    <formatter ref="binary" typeFilterLevel="Full" />
            </serverProviders>
            <clientProviders>
                    <formatter ref="binary" />
            </clientProviders>
      </channel>

    (3) Whenever I test the application, I clear out both the download
    assembly cache (with gacutil /cdl) and IE's browser cache. I also
    reset IIS from time to time.

    NOW HERE'S THE WEIRD PART. By studying IIS's log, I see that whenever
    I launch the app using No Touch Deployment, I see that IEExec is
    making over 20 GET requests of the server. Even though my http
    request is for myClientApp.exe, IEExec also tries to get
    myClientApp.exe.config, myClientApp.DLL, myClientApp.resources.DLL,
    etc. Most of these time out with 404 errors (no wonder it takes so
    long to launch), but TWO GET requests actually succeed:
    "myClientApp.exe" and "myClientApp.EXE" (spelled the same but with
    different case sensitivity).

    Checking the Global Assembly Cache with gacutil /ldl, I see that there
    are that two copies identical copies of the assembly (same name &
    version#). More useful is the IE InvalidExceptionError Window which
    also shows that there are two copies of myClientApp assembly except
    one has the lower case extension .exe and the other has the has the
    upper case .EXE extension.

    In this newsgroup, I found that it was documented that IEexec (used by
    No-Touch Deployment) has a side-effect of loading two copies of your
    assembly:

    Subject: Assemblies deployed with IE are downloaded multiple times ?
    http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=OQT8XxHdCHA.1864%40tkmsftngp11&rnum=4&prev=/groups%3Fq%3Dduplicate%2Bdownload%2Bassembly%2Bcache%26hl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26selm%3DOQT8XxHdCHA.1864%2540tkmsftngp11%26rnum%3D4

    RE: No Touch Deployment.
    http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=eNKAMy9lDHA.2416%40TK2MSFTNGP10.phx.gbl&rnum=2&prev=/groups%3Fq%3DMats-Erik%2BGrundh%2B(nospam%2540co.se)%2B%2BXin%2BHuang%26hl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26selm%3DeNKAMy9lDHA.2416%2540TK2MSFTNGP10.phx.gbl%26rnum%3D2

    For some reason, the fact that there are two versions of the assembly
    (even though they are identical except the case-sensitivity of the
    .EXE extension) seems to create a type-mismatch when client
    application tries to deserialize the Strongly Typed Dataset in the
    SOAP message.

    Does anyone have any suggestions or idea of what is going on?

    Thanks in advance,
    Paul Linhardt
    Paul_Linhardt@Lans mont.com <- remove space


  • Next message: Eric: "Strange ComboBox Behavior"

    Relevant Pages

    • Re: soapsuds
      ... > the 'server' assembly, then the soapsuds extraction falls over. ... > in .Net that namespaces cannot span assemblies? ... > interface defined in a shared assembly (which can be implemented my other ... dll which sits both on the server and the client allowing objects to talk to ...
      (microsoft.public.dotnet.framework.remoting)
    • Re: "Insufficient state to deserialize the object" error
      ... The delegate itself is a serializable object, so both client and server need ... > that requires serialization? ... >> If any of the assemblies are being loaded from the mapped drive, ...
      (microsoft.public.dotnet.framework.remoting)
    • Re: Can RCW and CCW be used together?
      ... component project reference to my client project and build. ... Dim iads As IadsAutomationLib.Application ... problem-domain specific assemblies and the assemblies for the RCW-Interop ...
      (microsoft.public.dotnet.framework.interop)
    • Re: Natural keys vs Aritficial Keys
      ... A welding shop client that empoyed hundreds of welders built and assembled very ... complex piping assemblies for refineries, power plants and oil sands plants. ... When a designer is exposed to this, a moment's thought should be enough to see that the different parties operate from distinct concepts. ...
      (comp.databases.theory)
    • Getting Strongly Named Flash Shockwave dlls for use with No-Touch Deployment Smart Client
      ... Client (e.g. No-Touch deployment). ... I found that unless I strongly named my application assembly, IEexec ... Strongly named assemblies cannot contain non-strongly named dll's. ... TlbImp error: ...
      (microsoft.public.dotnet.framework.windowsforms)