Call .NET class from Orchestration (update assembly reference)

Home Page Forums BizTalk 2004 – BizTalk 2010 Call .NET class from Orchestration (update assembly reference)

Viewing 2 reply threads
  • Author
    Posts
    • #19855

      Morning

       

      I am calling a .NET class from an Orchestration but when I update the .NET class BizTalk is still referencing the old assembly. How do I update the reference once the class has been updated?

       

      Thanks

      Byron

    • #19856

      dear you have to restart the host instance as it always caches the last instance of an assembly.

       

      regards,

      Faisal

       

      • #19858

         You will also have to rebuild and redeploy your Biztalk assembly that references the .NET assembly

        • #19860

           Thanks for the replies.

           

          I did resolve this by adding the assembly to the Resources folder of the application in the Administration Console and checking the Overwrite all checkbox.

          Is this a correct way of resolving it?

           

          Byron

          • #19862

            Byron,

            You don’t need to add it through the Add Resource functionality of the BizTalk Admin Console, because it isn’t a BizTalk assembly, BizTalk doesn’t need to know anything about it.

            Just add it to the Global Assembly Cache (GAC) and restart the Host Instance that is running the orchestration that is invoking the assembly.

            Be aware that you may have updated the Assembly version of the GACed assembly, in which case BizTalk won’t be able to find it as it will still be referencing the old assembly version. If you don’t want to re-compile the BizTalk project containing the orchestration to reference your new version, keep your helper assembly on the same version number, but increment the File Version – this is just meta-data and will be ignored when BizTalk tries to find your updated assembly, which it will because the version number has not changed, however you will be able to tell that you are running the correct version.

            Hope this helps,

            Rgds, Nick.

    • #19863

      You could add the class project to the solution containing your orchestration project.

      Then, in the orchestration project’s references, delete the existing reference to your class, and add a new reference from project, your class project will be available on the “projetcs” tab.

      At this point,  you can set the build profile to build and deploy both objects, the class and the orchestration.

      Refresh and restart the host instance as noted each time you redeploy.  You’re good to go.

      • #19867

        It would be best practice to rebuild your Biztalk assembly if it references a .NET assembly that is rebuilt. These assemblies are tightly coupled, and while it might work by keeping the same assembly version (it will be able to load the assembly), there is no guarantee that any calls to that assembly will work correctly.

        You can get weird and bizarre errors running mismatched assemblies.

Viewing 2 reply threads
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.