Deploying c# executables that uses dll's.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Daniel O'Connell

    #16
    Re: Deploying c# executables that uses dll's.

    Is this library a .NET assembly, or are you accessing it via pinvoke or com
    interop?
    <Olaf.Baeyens@s kyscan.be> wrote in message
    news:3f695679$0 $31727$ba620e4c @reader1.news.s kynet.be...[color=blue][color=green][color=darkred]
    > > > SkyscanLibBase, Version=1.0.135 4.27798
    > > > ctRepair, Version=1.0.135 5.22235
    > > >
    > > > But I do not think that these versions have anything to do with the[/color][/color]
    > problem.[color=green][color=darkred]
    > > > If I understand the version numbers correctly then ctRepair has
    > > > Version=1.0.135 5.22235 and expects SkyscanLibBase with
    > > > Version=1.0.135 4.27798[/color]
    > >
    > > Look at ctRepair with ildasm - in the manifest it should say which
    > > version it's expecting.
    > >[/color]
    > I checked at my home computer and there it installed without troubles.
    > When I copied the folder and the execute ctRepair (before using any
    > installer) then the program started up without problems, but gave an error
    > once I used a function found in this SkyscanLibBase. dll.
    >[/color]
    [color=blue]
    > Then I installed the software using the installer and it worked perfectt!
    > The dll was known.
    >
    > So far I can tell that computers that have VC++ .NET installed have no
    > problems to run the program, but computers that never had VC++ .NET
    > installed have this big problem not finding the dll.
    > One thing comes to mind is that the DLL build in VC++ 2002, is build with
    > MFC as dll, not static.
    > Could this be the cause of it? And where can I find this mfc dll? Up[/color]
    untill[color=blue]
    > now I always used static linking of mfc.
    > But in order to build the .NET managed dll, I had to build with mfc in a
    > dynamic library.
    >
    > Thanks for any feed-back. :-)
    > Olaf
    >
    >[/color]


    Comment

    • Guest's Avatar

      #17
      Re: Deploying c# executables that uses dll's.

      > Is this library a .NET assembly, or are you accessing it via pinvoke or
      com[color=blue]
      > interop?
      >[/color]

      First of all, this is all new for me, so maybe I make mistakes.
      But anyway, the installation should be straight forward for simmple users.

      The dll is a is a VC++ 2002 managed class wrapper from unmanaged VC++ 2002
      code.
      The program that uses this dll is pure C#.

      50% of our computers have no problem with the installation, the other 50%
      refuses to find the dll.
      Strange. The program starts up, but the very moment that I call one of the
      dll functions I am in trouble.
      I would compare this with the "undefined dynamic link error" you might have
      with old style dll

      I stop searching for the problem here, there are more important things to do
      right now.
      Maybe some othe time I will find the cause.

      Thanks for any feed-back.
      Olaf



      Comment

      • Guest's Avatar

        #18
        Re: Deploying c# executables that uses dll's.

        Ok, ok, I wanted to stop searching, but this part of the .NET exception
        seems to be interesting:
        The location of SkyscanLibBase. DLL is exactly at this position that the
        "LOG: Attempting download of new URL" is pointing too.
        So why does he not recognize this dll as the correct dll?

        -------
        LOG: Publisher policy file is not found.
        LOG: Host configuration file not found.
        LOG: Using machine configuration file from
        C:\WINNT\Micros oft.NET\Framewo rk\v1.1.4322\co nfig\machine.co nfig.
        LOG: Post-policy reference: SkyscanLibBase, Version=1.0.135 4.27798,
        Culture=neutral , PublicKeyToken= 83aac2de47135ec f
        LOG: Attempting download of new URL file:///C:/Program
        Files/Skyscan/Tools/CtRepair/SkyscanLibBase. DLL.
        -------

        50% of the computers finds this dll, the other 50% refuses. There seems not
        to be any pattern, (e.g. virus scanner, FAT32, NTFS, VC++ installed, VC++
        not installed, NET 1.0 installed). In all cases, after the setup installs
        the software, the program gets started, I see the form.

        And we are talking about a pure VC# 2002 compiled application here.
        Also the setup is created with the VC# 2002. .

        <Complete log file below>
        *************** *************** **
        *************** *************** **
        See the end of this message for details on invoking
        just-in-time (JIT) debugging instead of this dialog box.

        ************** Exception Text **************
        System.IO.FileN otFoundExceptio n: File or assembly name SkyscanLibBase, or
        one of its dependencies, was not found.
        File name: "SkyscanLibBase "
        at ctRepair.Form1. LoadDatasetInfo rmation()
        at ctRepair.Form1. menuItem2_Click (Object sender, EventArgs e)
        at System.Windows. Forms.MenuItem. OnClick(EventAr gs e)
        at System.Windows. Forms.MenuItemD ata.Execute()
        at System.Windows. Forms.Command.I nvoke()
        at System.Windows. Forms.Control.W mCommand(Messag e& m)
        at System.Windows. Forms.Control.W ndProc(Message& m)
        at System.Windows. Forms.Scrollabl eControl.WndPro c(Message& m)
        at System.Windows. Forms.Container Control.WndProc (Message& m)
        at System.Windows. Forms.Form.WndP roc(Message& m)
        at System.Windows. Forms.ControlNa tiveWindow.OnMe ssage(Message& m)
        at System.Windows. Forms.ControlNa tiveWindow.WndP roc(Message& m)
        at System.Windows. Forms.NativeWin dow.Callback(In tPtr hWnd, Int32 msg,
        IntPtr wparam, IntPtr lparam)

        === Pre-bind state information ===
        LOG: DisplayName = SkyscanLibBase, Version=1.0.135 4.27798, Culture=neutral ,
        PublicKeyToken= 83aac2de47135ec f
        (Fully-specified)
        LOG: Appbase = C:\Program Files\Skyscan\T ools\CtRepair\
        LOG: Initial PrivatePath = NULL
        Calling assembly : ctRepair, Version=1.0.135 6.20065, Culture=neutral ,
        PublicKeyToken= 83aac2de47135ec f.
        ===

        LOG: Publisher policy file is not found.
        LOG: Host configuration file not found.
        LOG: Using machine configuration file from
        C:\WINNT\Micros oft.NET\Framewo rk\v1.1.4322\co nfig\machine.co nfig.
        LOG: Post-policy reference: SkyscanLibBase, Version=1.0.135 4.27798,
        Culture=neutral , PublicKeyToken= 83aac2de47135ec f
        LOG: Attempting download of new URL file:///C:/Program
        Files/Skyscan/Tools/CtRepair/SkyscanLibBase. DLL.



        ************** Loaded Assemblies **************
        mscorlib
        Assembly Version: 1.0.5000.0
        Win32 Version: 1.1.4322.573
        CodeBase:
        file:///c:/winnt/microsoft.net/framework/v1.1.4322/mscorlib.dll
        ----------------------------------------
        System
        Assembly Version: 1.0.5000.0
        Win32 Version: 1.1.4322.573
        CodeBase:
        file:///c:/winnt/assembly/gac/system/1.0.5000.0__b77 a5c561934e089/system.dll
        ----------------------------------------
        System.Drawing
        Assembly Version: 1.0.5000.0
        Win32 Version: 1.1.4322.573
        CodeBase:
        file:///c:/winnt/assembly/gac/system.drawing/1.0.5000.0__b03 f5f7f11d50a3a/system.drawing. dll
        ----------------------------------------
        ctRepair
        Assembly Version: 1.0.1356.20065
        Win32 Version: 1.0.1356.20065
        CodeBase: file:///C:/Program%20Files/Skyscan/Tools/CtRepair/ctRepair.exe
        ----------------------------------------
        System.Windows. Forms
        Assembly Version: 1.0.5000.0
        Win32 Version: 1.1.4322.573
        CodeBase:
        file:///c:/winnt/assembly/gac/system.windows. forms/1.0.5000.0__b77 a5c561934e089/system.windows. forms.dll
        ----------------------------------------
        System.Xml
        Assembly Version: 1.0.5000.0
        Win32 Version: 1.1.4322.573
        CodeBase:
        file:///c:/winnt/assembly/gac/system.xml/1.0.5000.0__b77 a5c561934e089/system.xml.dll
        ----------------------------------------

        ************** JIT Debugging **************
        To enable just in time (JIT) debugging, the config file for this
        application or machine (machine.config ) must have the
        jitDebugging value set in the system.windows. forms section.
        The application must also be compiled with debugging
        enabled.

        For example:

        <configuratio n>
        <system.windows .forms jitDebugging="t rue" />
        </configuration>

        When JIT debugging is enabled, any unhandled exception
        will be sent to the JIT debugger registered on the machine
        rather than being handled by this dialog.




        Comment

        • Guest's Avatar

          #19
          Re: Deploying c# executables that uses dll's.

          > Back in the Old days, I compile a C++ executable, copy the dll's used by[color=blue]
          > this executable to the same folder. Go to another computer, copy that
          > folder locally, double click on the exe file and off we go....
          >
          > Today, I have a C# .NET executable, I copied the used .NET dll into the
          > same folder. Went to the other computer copied the folder locally. I[/color]
          double[color=blue]
          >click on the exe file and a lot of errors that looks like Access violations
          >except it is caled differently.[/color]

          I still have this problem when I try to deploy a .NET application that uses
          dll's.

          When I compile one exe then no big problems, but when the project consist of
          multiple .NET dll files then on 50% of the machines I test, I get an error
          like this or something similar.



          Any idea's how to discover why this happens so that I can fix he problem?


          Comment

          • Guest's Avatar

            #20
            Re: Deploying c# executables that uses dll's.

            > When I compile one exe then no big problems, but when the project consist
            of[color=blue]
            > multiple .NET dll files then on 50% of the machines I test, I get an error
            > like this or something similar.
            >
            > http://www.obaeyens.com/Skyscan/DOTN...ntProblem1.htm
            >
            > Any idea's how to discover why this happens so that I can fix he problem?[/color]

            I recently discovered something that might explain the problems.
            I appear to have 2 problems:

            * I am missing a .config file that contains information about the used
            dll's.
            * I cannot run the code from a network driver directly, when I copy it to a
            local folder then it just works.

            This config file can be created using a mmc plugin, or can be done by hand.

            The big questions are now:
            * How to I configure this to run from a network drive.
            * Do I need these in the config file?: mscorlib, System.Drawing,
            System.Windows. Forms, System, System.Runtime. Serialization.F ormatters.Soap,
            Accessibility" publicKeyToken. ..


            <?xml version="1.0"?>
            <configuratio n>
            <runtime>
            <assemblyBindin g xmlns="urn:sche mas-microsoft-com:asm.v1">
            <dependentAssem bly>
            <assemblyIdenti ty name="Win32" publicKeyToken= "83aac2de47135e cf" />
            </dependentAssemb ly>
            <dependentAssem bly>
            <assemblyIdenti ty name="SkyscanLi bBase"
            publicKeyToken= "83aac2de47135e cf" />
            </dependentAssemb ly>
            <dependentAssem bly>
            <assemblyIdenti ty name="SkyscanVi sBase"
            publicKeyToken= "83aac2de47135e cf" />
            </dependentAssemb ly>
            <dependentAssem bly>
            <assemblyIdenti ty name="Microsoft .VisualC"
            publicKeyToken= "b03f5f7f11d50a 3a" />
            </dependentAssemb ly>
            <dependentAssem bly>
            <assemblyIdenti ty name="System.Wi ndows.Forms"
            publicKeyToken= "b77a5c561934e0 89" />
            </dependentAssemb ly>
            <dependentAssem bly>
            <assemblyIdenti ty name="System.Dr awing"
            publicKeyToken= "b03f5f7f11d50a 3a" />
            </dependentAssemb ly>
            <dependentAssem bly>
            <assemblyIdenti ty name="mscorlib" publicKeyToken= "b77a5c561934e0 89"
            />
            </dependentAssemb ly>
            <dependentAssem bly>
            <assemblyIdenti ty name="System" publicKeyToken= "b77a5c561934e0 89" />
            </dependentAssemb ly>
            <dependentAssem bly>
            <assemblyIdenti ty
            name="System.Ru ntime.Serializa tion.Formatters .Soap"
            publicKeyToken= "b03f5f7f11d50a 3a" />
            </dependentAssemb ly>
            <dependentAssem bly>
            <assemblyIdenti ty name="Accessibi lity"
            publicKeyToken= "b03f5f7f11d50a 3a" />
            </dependentAssemb ly>
            </assemblyBinding >
            </runtime>
            </configuration>


            Comment

            • Guest's Avatar

              #21
              Re: Deploying c# executables that uses dll's.

              > >When I compile one exe then no big problems, but when the project consist[color=blue][color=green]
              >> of multiple .NET dll files then on 50% of the machines I test, I get an[/color][/color]
              error[color=blue][color=green]
              > > like this or something similar.
              > >
              > > http://www.obaeyens.com/Skyscan/DOTN...ntProblem1.htm
              > >
              > > Any idea's how to discover why this happens so that I can fix he[/color][/color]
              problem?[color=blue]
              >
              > I recently discovered something that might explain the problems.
              > I appear to have 2 problems:
              >
              > * I am missing a .config file that contains information about the used
              > dll's.
              >
              > * I cannot run the code from a network driver directly, when I copy it to[/color]
              a[color=blue]
              > local folder then it just works.
              >[/color]

              And a 3rd problem thing was some missing VC++ 2002 dll's.
              --> mfc70.dll, msvcp70.dll and msvcr70.dll

              One of the dll's I used was a VC++ 2002 dll that contains a mixture of
              managed and unmanaged code.
              In order to let this thing compile, I had to use the dynamic loaded MFC
              dll's.

              It would be nice if the JIT compile somehow tells me that some dl's are
              missing in order to execute this program.
              The error I got so far did not help me in any way to find these simple
              sollutions.
              In fact it added more to the confusion and took longer to find the
              sollutions.


              Comment

              Working...