Biztalk : Could not load file or assembly ‘Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ or one of its dependencies. The system cannot find the file specified

Error: Biztalk : Could not load file or assembly ‘Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ or one of its dependencies. The system cannot find the file specified

Solution:
This error will come when you will call .net assembly from BizTalk orchestration using Expression shape or Message Assignment shape. The error telling you that the .Net assembly could not loaded means the .Net assembly is not exist in Globle Assembly Cache(GAC). So you have to put the particular assembly in GAC.

You can keep the assembly in GAC using the GACUtil command. Suppose you have the “Microsoft.Practices.EnterpriseLibrary.Logging” file in “C:\program Files\Microsoft Enterprise Library 3.1 – May 2007\Bin” folder. Open the microsoft Visual Studio Command Prompt. Then change the directory to this path(“C:\program Files\Microsoft Enterprise Library 3.1 – May 2007\Bin” ) and write the following command to put the assembly in GAC:GACUtil i/ Microsoft.Practices.EnterpriseLibrary.Logging.dllIts will install the Microsoft.Practices.EnterpriseLibrary.Logging.dll in GAC.Now restart your BizTalk Service Host and stop and start your BizTalk application. Then test your orchestration. It will resolve your problem.Cheers:)

Regards,
Vijay Modi

Advertisements

About Vijay Modi

Having 12+ years of experience in web application development. Expertise in various domains like E-Commerce, E-Learning, Insurance. I have expertise in web application development, window application development, Performance improvement, bug fixing etc. I have worked on various Microsoft technologies including ASP.Net, MVC, WebApi, WCF, Entity Framework, WPF, Window Application Development, AWS, Azure, AngularJS 2.0 / 1.5.2, .NetCore framework, jQuery. I am believing in quality work and achieving deadlines. Also like to work on new technologies and quick learner.
This entry was posted in BizTalk Server and tagged , . Bookmark the permalink.

17 Responses to Biztalk : Could not load file or assembly ‘Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ or one of its dependencies. The system cannot find the file specified

  1. Aun Ali Siraj says:

    can You Tell Me how can i install Gac utill

  2. Vijay Modi says:

    To install any assembly in GAC u can use the GACUtil.

    1>Open the Visual Studio Command Prompt.
    2>Move to the directory where your assembly(dll) is located.
    3> write the following command in you Visual Studio Command Prompt.

    GACUtil /i urDllName.dll

    Let me know still you have any issue.

    Regards,
    Vijay modi

  3. Malathi says:

    The solution you gave doesn’t solve the problem. I installed the assembly in GAC but no luck. The following is the error i am getting…can you pls help me out to solve this problem.

    Uncaught exception (see the ‘inner exception’ below) has suspended an instance of service ‘LogMethod.LogProcess(3c45ab11-3512-0116-eaff-acfd8aa40ce4)’.
    The service instance will remain suspended until administratively resumed or terminated.
    If resumed the instance will continue from its last persisted state and may re-throw the same unexpected exception.
    InstanceId: 365f8ae8-02e9-4bca-8cdf-9441f71a45e1
    Shape name: ConstructMessage_1
    ShapeId: a37a764c-4a95-4453-81bf-f5681075b5ea
    Exception thrown from: segment 1, progress 8
    Inner exception: The type initializer for ‘Microsoft.Practices.EnterpriseLibrary.Logging.LogEntry’ threw an exception.

    Exception type: TypeInitializationException
    Source: Microsoft.Practices.EnterpriseLibrary.Logging
    Target Site: Void .ctor()
    The following is a stack trace that identifies the location where the exception occured

    at Microsoft.Practices.EnterpriseLibrary.Logging.LogEntry..ctor()
    at LoggingMethod.LogDetails.LogError(String ex)
    at LogMethod.LogProcess.segment1(StopConditions stopOn)
    at Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s, StopConditions stopCond, Exception& exp)
    Additional error information:

    Could not load file or assembly ‘Microsoft.Practices.EnterpriseLibrary.Common, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ or one of its dependencies. The system cannot find the file specified.

    Exception type: FileNotFoundException
    Source: mscorlib
    Target Site: System.RuntimeMethodHandle ResolveMethod(Int32, System.RuntimeTypeHandle*, Int32, System.RuntimeTypeHandle*, Int32)
    The following is a stack trace that identifies the location where the exception occured

    at System.ModuleHandle.ResolveMethod(Int32 methodToken, RuntimeTypeHandle* typeInstArgs, Int32 typeInstCount, RuntimeTypeHandle* methodInstArgs, Int32 methodInstCount)
    at System.ModuleHandle.ResolveMethodHandle(Int32 methodToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
    at System.ModuleHandle.ResolveMethodHandle(Int32 methodToken)
    at System.RuntimeType.GetMethodBase(ModuleHandle scope, Int32 typeMetadataToken)
    at System.RuntimeType.GetMethodBase(Module scope, Int32 typeMetadataToken)
    at System.Reflection.CustomAttributeData..ctor(Module scope, CustomAttributeRecord caRecord)
    at System.Reflection.CustomAttributeData.GetCustomAttributes(Module module, Int32 tkTarget)
    at System.Reflection.CustomAttributeData.GetCustomAttributes(Assembly target)
    at System.Resources.ResourceManager.GetNeutralResourcesLanguage(Assembly a, UltimateResourceFallbackLocation& fallbackLocation)
    at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)
    at System.Resources.ResourceManager.GetString(String name, CultureInfo culture)
    at Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter..ctor()
    at Microsoft.Practices.EnterpriseLibrary.Logging.LogEntry..cctor()

    For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

  4. Vijay Modi says:

    Hi Malathi,

    Please read the full error message you sent. You need to install the :
    Microsoft.Practices.EnterpriseLibrary.Common

    assembly too in the GAC. the logging assembly is dependent on this Microsoft.Practices.EnterpriseLibrary.Common assembly.

    Please install this too. It will resolve your error.

    Regards,
    Vijay Modi

  5. Pavan says:

    Even i had same problem, now it got resolved.
    Thanks for ur post…

  6. DS says:

    Hi ,

    I am using Biztalk server 2006 R2 and trying to call .net component which I have compiled using X86 platform. I have compiled .net component using X86 Platform because of the requirement of the project . Now my Orchestration is not picking the .net component even though I have all the assemblies in GAC.. I am getting following XLANG error. Please let me know if you have any idea on this.

    Error :
    Uncaught exception (see the ‘inner exception’ below) has suspended an instance of service ‘MyMQTest.OrderOrch(69bdce26-9e61-25ac-6b08-449c2c8ddd50)’.
    The service instance will remain suspended until administratively resumed or terminated.
    If resumed the instance will continue from its last persisted state and may re-throw the same unexpected exception.
    InstanceId: 7d364507-507d-4c1b-8191-298776a9a34e
    Shape name:
    ShapeId:
    Exception thrown from: segment -1, progress -1
    Inner exception: Could not load file or assembly ‘MQClsLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a2ea9aedd6d3df19’ or one of its dependencies. The system cannot find the file specified.

    Exception type: FileNotFoundException
    Source: MyMQTest
    Target Site: Microsoft.XLANGs.Core.StopConditions segment1(Microsoft.XLANGs.Core.StopConditions)
    The following is a stack trace that identifies the location where the exception occured

    at MyMQTest.OrderOrch.segment1(StopConditions stopOn)
    at Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s, StopConditions stopCond, Exception& exp)

    For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

    Thanks ,
    DS

  7. Vijay Modi says:

    Hi DS,

    There problem is that the “MQClsLib” is not in GAC. Please check it. And there might be the following problem:

    Exception type: FileNotFoundException
    Source: MyMQTest
    Target Site: Microsoft.XLANGs.Core.StopConditions segment1(Microsoft.XLANGs.Core.StopConditions)

    I think its not finding the File. please check it too. And then restart your host instance. Its required to restart the Host Instance in which your application is running.

    Thanks,
    Vijay Modi

  8. DS says:

    Vijay,

    Thanks for your Reply, I do have “MQClsLib” in GAC. I have only one version of this dll so there is no version conflict. I also tried restart Host instance on which my Biztalk application is running but still i am getting the same error.

    I think the problem is when I compile “MQClsLib” using X86 Platform the file is not getting picked by biztalk application.

    As I mentioned earlier I am working on Biztalk Server 2006 R2 on operating system Windows Server 2003 Standard x64 edition. I have Visual studio 2005 installed on the same box.

    So When I compile my MQClsLib using x86 platform Biztalk doesn’t pick the dll . I tried creating other class library and compiled it using “Any CPU” platform and found that Biztalk picks that and execute even . But as per the requirement of my project I can not change MQClsLib to “AnyCPU”.

    Please let me know if you have any idea on this problem.

    Thanks in advance.

    DS

  9. Vijay Modi says:

    Hi DS,

    Please insert the Microsoft.XLANGs.Core.StopConditions in the GAC. And restart the Host Instance and test the application. This might be the problem on this side too.

    Regards,
    Vijay Modi

  10. Bilyana says:

    Thanks a lot, that solved my problem.

  11. Muhammad Afzal says:

    Hi,
    I had the same problem and when I look at the error message is says “Uncaught exception (see the ‘inner exception’ below) has suspended an instance of service “. This mean that there is already a running instance of your orchestration and is in suspned mode. Now there are two ways to resolve this.

    1) Go to BizTalk Admin, find the suspended instance and terminate.

    2) Restart the host instance.

    Regards,
    Muhammad Afzal

  12. rashid says:

    plz

    help me

    ************** Exception Text **************
    System.IO.FileNotFoundException: File or assembly name CrystalDecisions.CrystalReports.Engine, or one of its dependencies, was not found.
    File name: “CrystalDecisions.CrystalReports.Engine”
    at NCE_SYSTEM.purchase.particular_report()
    at NCE_SYSTEM.purchase.Button3_Click(Object sender, EventArgs e) in C:\Documents and Settings\rashid\My Documents\Visual Studio Projects\NCE SYSTEM\purchase.vb:line 1374
    at System.Windows.Forms.Control.OnClick(EventArgs e)
    at System.Windows.Forms.Button.OnClick(EventArgs e)
    at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
    at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
    at System.Windows.Forms.Control.WndProc(Message& m)
    at System.Windows.Forms.ButtonBase.WndProc(Message& m)
    at System.Windows.Forms.Button.WndProc(Message& m)
    at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
    at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

    === Pre-bind state information ===
    LOG: DisplayName = CrystalDecisions.CrystalReports.Engine, Version=9.1.5000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304
    (Fully-specified)
    LOG: Appbase = C:\Documents and Settings\rashid\My Documents\Visual Studio Projects\NCE SYSTEM\bin\
    LOG: Initial PrivatePath = NULL
    Calling assembly : NCE SYSTEM, Version=1.0.3371.14575, Culture=neutral, PublicKeyToken=null.
    ===

    LOG: Publisher policy file is not found.
    LOG: Host configuration file not found.
    LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\config\machine.config.
    LOG: Post-policy reference: CrystalDecisions.CrystalReports.Engine, Version=9.1.5000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304
    LOG: Attempting download of new URL file:///C:/Documents and Settings/rashid/My Documents/Visual Studio Projects/NCE SYSTEM/bin/CrystalDecisions.CrystalReports.Engine.DLL.
    LOG: Attempting download of new URL file:///C:/Documents and Settings/rashid/My Documents/Visual Studio Projects/NCE SYSTEM/bin/CrystalDecisions.CrystalReports.Engine/CrystalDecisions.CrystalReports.Engine.DLL.
    LOG: Attempting download of new URL file:///C:/Documents and Settings/rashid/My Documents/Visual Studio Projects/NCE SYSTEM/bin/CrystalDecisions.CrystalReports.Engine.EXE.
    LOG: Attempting download of new URL file:///C:/Documents and Settings/rashid/My Documents/Visual Studio Projects/NCE SYSTEM/bin/CrystalDecisions.CrystalReports.Engine/CrystalDecisions.CrystalReports.Engine.EXE.

    ************** Loaded Assemblies **************
    mscorlib
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.573
    CodeBase: file:///c:/windows/microsoft.net/framework/v1.1.4322/mscorlib.dll
    —————————————-
    NCE SYSTEM
    Assembly Version: 1.0.3371.14575
    Win32 Version: 1.0.3371.14575
    CodeBase: file:///C:/Documents%20and%20Settings/rashid/My%20Documents/Visual%20Studio%20Projects/NCE%20SYSTEM/bin/NCE%20SYSTEM.exe
    —————————————-
    System.Windows.Forms
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.573
    CodeBase: file:///c:/windows/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll
    —————————————-
    System
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.573
    CodeBase: file:///c:/windows/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
    —————————————-
    System.Drawing
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.573
    CodeBase: file:///c:/windows/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll
    —————————————-
    System.Data
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.573
    CodeBase: file:///c:/windows/assembly/gac/system.data/1.0.5000.0__b77a5c561934e089/system.data.dll
    —————————————-
    Microsoft.VisualBasic
    Assembly Version: 7.0.5000.0
    Win32 Version: 7.10.3052.4
    CodeBase: file:///c:/windows/assembly/gac/microsoft.visualbasic/7.0.5000.0__b03f5f7f11d50a3a/microsoft.visualbasic.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:

  13. rashid says:

    plz
    help me

    vb.net 2003 platform :file or assembly name CrystalDecisions.CrystalReports.Engine, or one of its dependencies, was not found.

  14. Uday says:

    hi,

    I am also facing the same issue while testing MAP in visual studio biztalk project, need your help in solving the same
    Error
    TestMap used the following file: as input to the map.
    D:\BizTalk Source Code\Production_Order_OnDemand\SAP_2_FlexNet.btm: error btm1050: XSL transform error: Unable to write output instance to the following . Could not load file or assembly ‘Utilities, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’ or one of its dependencies. The system cannot find the file specified.

    i also need to understand how to “insert the Microsoft.XLANGs.Core.StopConditions in the GAC”

  15. sds says:

    Inner exception: The type initializer for ‘RGICL.ESB.PORTAL.RPAS.Orchestrations.__Microsoft_Practices_ESB_ExceptionHandling_Schemas_Faults_FaultMessage__’ threw an exception.

  16. sds says:

    can any one help me in this
    iam getting this error in biztalk

  17. sds says:

    Uncaught exception (see the ‘inner exception’ below) has suspended an instance of service ‘RGICL.ESB.PORTAL.RPAS.Orchestrations.PORTALRPASOrchestration(e94f0f28-718a-c006-6139-499fb8ea099f)’.
    The service instance will remain suspended until administratively resumed or terminated.
    If resumed the instance will continue from its last persisted state and may re-throw the same unexpected exception.
    InstanceId: 33c516e7-6f68-4217-9494-5f2259c88b27
    Shape name: Xform_FaultMsgTOESBFaultMsg
    ShapeId: efff02f4-3deb-48a5-bc23-1932700f415b
    Exception thrown from: segment 7, progress 9
    Inner exception: The type initializer for ‘RGICL.ESB.PORTAL.RPAS.Orchestrations.__Microsoft_Practices_ESB_ExceptionHandling_Schemas_Faults_FaultMessage__’ threw an exception.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s