Frequently, when you try to undeploy an assembly, Biztalk returns the following error:

Some items in the removed assembly are still being used by items not defined in the same assembly, thus removal of the assembly failed.
Make sure that items in the assembly you are trying to remove fulfill the following conditions:
1. Pipelines, maps, and schemas are not being used by Send Ports or Receive Locations
2. Roles have no enlisted parties.
Undeployment failed.

The error is not nice enough to tell you the offending maps.

Here is an SQL Query that will identify maps in both send and receive ports:

select
  'RcvPort' PortType,
  r.nvcName Port,
  item.name MapName,
  assem.nvcName Assembly,
  nSequence, indoc_docspec_name, outdoc_docspec_name
from bts_receiveport_transform rt
inner join bts_receiveport r on rt.nReceivePortID = r.nID
inner join bt_mapspec ms on ms.id = rt.uidTransformGUID
inner join bts_assembly assem on ms.assemblyid = assem.nID
inner join bts_item item on ms.itemid = item.id
--order by Port, nSequence

union

select
  'SendPort' PortType,
  r.nvcName Port,
  item.name MapName,
  assem.nvcName Assembly,
  nSequence, indoc_docspec_name, outdoc_docspec_name
from bts_sendport_transform rt
inner join bts_sendport r on rt.nSendPortID = r.nID
inner join bt_mapspec ms on ms.id = rt.uidTransformGUID
inner join bts_assembly assem on ms.assemblyid = assem.nID
inner join bts_item item on ms.itemid = item.id
order by PortType, Port, nSequence

The tables are different for Receive Ports and Send Ports, so you can either run the query you need separately, or the above will “union” them together into one report.
Enjoy!

Tagged with:

Filed under: DeploymentVisualStudio