none
Complie C# Code without requirement of TLB Interop.MSUtill.dll file RRS feed

  • Question

  • Hello

    Recently, I have written a simple LogParser Application in C#

    C# Code is As follow

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using MSUtil;
    namespace getHttpStatusCode
    {
        class getHttpStatusCode
        {
            public static LogQueryClassClass LogParser = new LogQueryClassClass();
            public static COMIISW3CInputContextClass inputContext = new COMIISW3CInputContextClassClass();

            public static ILogRecordset rsLP = null;
            public static ILogRecord rowLP = null;
            
            static int Main(string[] args)
            {
                   // Written a LogParser expression to Parse certain ISW3C Logs.

             }

    }

    The code work charmingly and I do not have any issue with it.

    Question:

    When ever I complie the code a DLL File is being generated

    Interop.MSUtil.dll

    Yes I undertstand because it is generated, as I am Directly referencing the LogParser.dll COM

    But I need to find ways to Using the Complied version with out that "Interop.MSUtil.dll "

    Let Us say, on Another Machine,

    I registered the " LogParser.dll " and it is Successful and able to Find that registered class in the

    dcomcnfg as "MSUti"

    Registered command

    regsvr32 "Location of the LogPasrser.dll"

    After that when ever I ran the Complied Execution it always, Look for"Interop.MSUtil"

    C:\...\Desktop>getHttpStatusCode.exe
    Unhandled Exception: System.TypeInitializationException: The type initializer for 'getHttpStatusCo
    xception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Interop.MSUtil, V
     PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
    File name: 'Interop.MSUtil, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
       at getHttpStatusCode.getHttpStatusCode..cctor()

    WRN: Assembly binding logging is turned OFF.
    To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!En
    Note: There is some performance penalty associated with assembly bind failure logging.
    To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

       --- End of inner exception stack trace ---

       at getHttpStatusCode.getHttpStatusCode.Main(String[] args)

    ***************************************************************************

    Yes, I also know that copying the Interop.MSUtil.dll file next to the exe the code executes properly.

    My Question

    Why it need "Interop.MSUtil.dll" even though the COM "LogParser.dll" is registered.

    Need to Procedure, a compile my Executable without the requirement of the "Interop.MSUtil.dll"

    Note:

    I am Using the Visual Studio 2008

    Version 9.0.21022.8 RTM ( .NET 3.5 SP 1)

    And Interop.MSUtil.dll file is generated by the Visual Studio and I did not create that file.

    I just directly referenced the LogParser.dll in my Project. That is all.

    Any Help on this appreciated, as I tried lot of R&D but nothing seems to working for me.

    Thanks and Regards

    Durai Velan C


    Durai Velan

    Tuesday, December 2, 2014 11:19 AM

Answers

  • Hello Durai,

    >> When ever I complie the code a DLL File is being generated Interop.MSUtil.dll

    In actual, when you add a reference to the LogParser.dll, it actually adds a reference to the Interop.MSUtil.dll, you could check it. As far as I know, Interop.MSUtil.dll file is an important component for system that it supports the normal operation of associated program and ensures the system efficiently gets the data. Also, it provides the functions of checking the necessary spaces for the operation of program and if there is any similar code already exists in the system. If Interop.MSUtil.dll file is missing or damaged, there would be a couple of programs affected. So it should be necessarily to use this dll, and after testing with a higher version Visual Studio as VS2013 in order to use the embed interop types property, however, this dll seems to meet the limitation described in this blog, and since this dll is a system dll, we cannot modify it.

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, December 3, 2014 2:27 AM
    Moderator
  • You can find more information about the automatically generated Interop DLL here. (The article name it metadata.dll but there's the same thing)
    Wednesday, December 3, 2014 6:06 AM
    Answerer

All replies

  • Hello Durai,

    >> When ever I complie the code a DLL File is being generated Interop.MSUtil.dll

    In actual, when you add a reference to the LogParser.dll, it actually adds a reference to the Interop.MSUtil.dll, you could check it. As far as I know, Interop.MSUtil.dll file is an important component for system that it supports the normal operation of associated program and ensures the system efficiently gets the data. Also, it provides the functions of checking the necessary spaces for the operation of program and if there is any similar code already exists in the system. If Interop.MSUtil.dll file is missing or damaged, there would be a couple of programs affected. So it should be necessarily to use this dll, and after testing with a higher version Visual Studio as VS2013 in order to use the embed interop types property, however, this dll seems to meet the limitation described in this blog, and since this dll is a system dll, we cannot modify it.

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, December 3, 2014 2:27 AM
    Moderator
  • You can find more information about the automatically generated Interop DLL here. (The article name it metadata.dll but there's the same thing)
    Wednesday, December 3, 2014 6:06 AM
    Answerer