Archive

Posts Tagged ‘Biztalk2010’

Biztalk: Failed to add resource(s). Change requests failed for some resources


Today while deploying a Biztalk project I got the following error

Error 33 Access to the path ‘C:\Users\alasaad\Local Settings\Temp\BT\PID3624\BizTalkAssembly\4120c07368b1efbdf0cf62f9cd6bc7eb\MyBiztalkProject.dll’ is denied

Cleaned the project, restarted Visual studio. No good. I then rebooted the machine and I got this error

Error 42 Failed to add resource(s). Change requests failed for some resources. BizTalkAssemblyResourceManager failed to complete end type change request. Assembly “C:\Users\alasaad\AppData\Local\Temp\2\BT\PID5652\BizTalkAssembly\4120c07368b1efbdf0cf62f9cd6bc7eb\MyBiztalkProject.dll” does not appear to be a BizTalk assembly, and cannot be deployed to the Configuration database. If this assembly is referenced by other BizTalk assemblies, it needs to be installed into the global assembly cache (GAC) of each BizTalk server.

To fix the above I had to Add the following to the AsseblyInfo.cs. See

[assembly: Microsoft.XLANGs.BaseTypes.BizTalkAssemblyAttribute(typeof(BTXService))]

Seems that I deleted that line by mistake 🙂

Advertisements
Categories: Biztalk, Biztalk 2010 Tags: ,

Biztalk: Instance was not successfully terminated. Status is Pending


Sometimes when you try to terminate messages in Biztalk, messages may fail to terminate. Before you force the termination, you need to make sure you are ONLY terminating the messages you intend to terminate.

To force the termination, try one of the following:

Restart/Stop host instances assigned to the port or orchestration

Recycle the application pool assigned to the Webservice/WCF service if the port’s host is an isolated host

You can also wait for Biztalk to finish retrying sending the message, hence messages become suspended instances

Biztalk: Error if shared data is updated in a parallel then all references in every task must be in a synchronized or atomic scope


To solve the issue,

  • Wrap the shapes in each branch with a scope
  • Go the properties of each added scope
  • Set the Synchronized Property true (Apply on each scope on each branch)

image

  • Set the Transaction Type based on your requirements. In my case I am using None.
Categories: Biztalk, Biztalk 2010 Tags: ,

Biztalk: The “XLangTask” task failed unexpectedly


Last Monday I started, mainly, a Biztalk contract with a previous client. When I tried to build some of the work I have done before I was getting the following error:

Error 1 The “XLangTask” task failed unexpectedly.
System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {1BBA9F19-D4CC-34AA-918C-44FEF11E8274} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
at Microsoft.VisualStudio.BizTalkProject.Compiler.XLangCompiler.Compile(BizTalkBuildSnapshot buildSnapshot, IEnumerable`1 orchestrationFilesToCompile, String switches, String outputPath, List`1& generatedCodeFiles)
at Microsoft.VisualStudio.BizTalkProject.BuildTasks.XLangTask.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask, Boolean& taskResult)

The environment was:
Windows Server 2008 R2
Biztalk 2010 Enterprise Edition
SQL Server 2008 R2
VS2010 Ultimate

I tried few things like cleaning the solution, change the build target ..etc. Nothing worked. Finally, I decided to repair Biztalk:

Control Panel –> UnInstall Programs –> click Microsoft Biztalk Server Enterprise Edition –> Uninstall/Change. Choose Repair option when prompted

And That fixed it

Categories: Biztalk, Biztalk 2010 Tags: ,

Cumulative update packages for BizTalk Server 2010

Categories: Biztalk, Biztalk 2010 Tags: ,

Biztalk Configure WCF-SQL Adapter for Outbound Operation using Typed Stored Procedure


  • Follow the steps in section Consume Adapter Service
  • Select sqlBinding from the dropdown
  • Click the Configure button

  • In the secure tab, select Windows from the “client credential type” drop down
  • In the URI Properties tab, enter the Server name, InstanceName and IntialCatalog. In the following figure the server is “LocalHost”, we are using the default instance, and IntialCatalog the name of the adventureworks2008R2 database

  • Click Binding Properties

  • Click Ok
  • Click the Connect button
  • Select Client (Outbound operations)
  • Click Strongly-Typed Procedures from the “Select a category” list
  • Select a stored procedure from the “Available categories and operations” list
  • Click the Add button. Notice that the stored procedure is now list in the “Added categories and operations”
  • You can click the properties button to view the schema that will be generated
  • You can add multiple stored procedures if you want to have them all under one schema

  • Click OK
  • Notice in the solution explorer window that two files are add; one is the xsd schema and the other is the binding xml file

  • IMPORTANT:
    • You can add the schema to the Schmas or any other folder. Make sure you modify the name space
    • You can change the Type Name and File Name

    • Open the XSD file by double clicking on it
    • Select the Schema Node

    • Make sure that you DO NOT change the target Namespace
    • Make sure you DO NOT modify the elements’ names

  • Import port binding by following these steps
    • Open Biztalk admin console
    • Expand Biztalk server administration
    • Expand Biztalk groups
    • Expand Applications
    • Right click on the application you want to import the port to
    • Select Import à bindings
    • Select the generated xml file from step 16
    • Select the send ports node

    • Double click on the send port

    • Click Configure
    • If you only have one operation, Copy the value of the Action element, clear the textbox and past the copied value into the textbox

    • Click Ok

Consume Adapter Service in Biztalk Application

  • Right click on the Biztalk project
  • Click AddàAdd Generated Items

  • Click Consume Adapter Service

  • Click Add
Categories: Biztalk, Biztalk 2010, WCF Tags: , ,

Build Biztalk Deployment Framework Projects using TFS2010


The Biztalk Deployment Framework (BTDF) is a utility to help Biztalk administrators to easily output the Biztalk application, its components, configuration, and port bindings to an MSI package. Building Biztalk and BTDF projects can be automated using TFS Team Build because those projects are built using MSBuild. In TFS 2010, Microsoft changed the team build template from MSBuild configuration file to Workflow (WF4) activity. I have seen many posts asking how to use TFS Team Build to build BTDF projects but yet no one blogged about it. In this post, I will be modifying the default TFS2010 Team Build Template to support building BTDF msi packages.

Creating new Team Build Definition

  • Right click on one of the Teambuild definitions
  • Click New Build Definition

  • Enter the name of the build definition

  • Fill the Trigger, workspace and build default sections
  • Click on Process on the left
  • Click on Show Details
  • Click the New button
  • Click browse next to “Select the file to copy”
  • Select the Default Template, you can select the template you want to modify

  • Give it a name; I am naming it BTDFBuildProcessTemplate
  • Click Ok
  • In the Required group, click the ellipsis next to Items to Build
  • Add the solution you need to build which contains your Biztalk project(s)
  • Add the BTDF project you need to build, make sure that you switch the Items of type to *.*proj

  • Make sure that the solution is built first then the BTDFProj
  • Click the Configurations tab
  • My solution contains X86 and Any CPU projects, therefore I am choosing “Mixed Platforms”

  • Click OK
  • For this post, I am not running unit tests. Thus, I cleared the Automated Tests property
  • Change the MSBuild Platform to X86, otherwise Biztalk projects will fail

  • Save the build definition
  • Close the Team Build Definition.
  • Open Source Control from Team Explorer
  • Browse to the BuildProcessTemplates folder
  • Get latest version of the template we just created

Changes to the Default Template to Build Deployment Framework Projects

In this section, we will be modifying the workflow template we created in the previous section. Team build is different than building the solution from the visual studio. Team build creates two folders: one for the source files and one for the output called binaries. .btdfproj references biztalk dlls using a relative path which will be invalid when building the btdfproj using team build. We have two options, either to maintain the project structure and output the binaries to the source folder or add a condition to the .btdfproj to get the file from a different location when using Team Build. In this post, I will output the files into the bin folder in the source folder. This approach will affect your unit tests if you are running unit tests as team build checks the dlls in the binaries folder. It also affects copying the binaries to the drop folder. Another modification needs to be done to get this working. I will write another post to do such adjustment. The following steps adds activities to build the solutions and BTDF projects. The binaries of the projects will be output into the bin folder of each project in the source folder

  • Open the BTDFBuildProcessTemplate.xaml workflow xaml file created in the previous section
  • Click Collapse All

  • Expand On Agent

  • Expand the follow activities:
    • Try Compile, Test, and Associate Changesets and Work Items
    • Sequence
    • Compile, Test, and Associate Changesets and Work Items
    • Try Compile and Test
    • Compile and Test
    • For Each Configuration in BuildSettings.PlatformConfigurations
    • Compile and Test for Configuration
    • If BuildSettings.HasProjectsToBuild
    • For Each Project in BuildSettings.ProjectsToBuild
    • Try to Compile the Project
    • Compile the Project
  • Add a condition to check the type of the project to build by added an If activity between “Convert Server patch to Local” and “Run MSBuild for Project”

  • Drag and drop the “Run MSBuild for Project” to the Else section

  • In the If condition, check if the project extension is .btdfproj by entering the following condition:

IO.Path.GetExtension(localProject).Equals(“.btdfproj”)

  • Change the OutDir property to “” to output the binaries into the bin folder in the source directory. Thanks to Ajith  
  • Change the Display name of the if activity to something meaningful

  • If the project is a biztalk deployment framework project (*.btdfproj),
    • Add a new MSBuild activity to the If body, and rename it to Build BTDF Msi’s

  •  
    • Run msbuild (Build BTDF Msi’s activity) with the following arguments; we have set OutDir to “” to output the binaries into the source folder directory instead of the binaries folder.

  • Save the workflow and close it
  • Go to Source Control àBuildProcessTemplates
  • Checkin the workflow that was modified

  • Queue a new build
  • After the build is done, you will find the projects’ executables and BTDF msi in the bin folder of each project