Failed to add resource(s). Resource (…) is already in store and is either associated with another application or with another type.

Posted: November 15, 2012  |  Categories: BizTalk Visual Studio

One of my team members that are making some changes to a project that I started, called me saying that he was having problems in deploying the project. Whenever he tried to deploy the project he was stuck in the following error:

Failed to add resource(s). Resource (…) is already in store and is either associated with another application or with another type.

Failed to add resource associated with another application or type

First, we have to understand this type of error message…

Cause

When this message occurs, usually means that the resource we are trying to deploy is already deployed.

Before you can deploy a solution from Visual Studio (2005, 2008, 2010 …) into a BizTalk application, you must first set project properties. If a solution in Visual Studio contains multiple projects, you must separately configure properties for each project:

  • In Visual Studio Solution Explorer, right-click a project for which you want to configure properties, and then click Properties.
  • Click the Deployment tab in Project Designer.
  • and configuring at least the following properties:
    • Application Name: Name of the BizTalk application to which to deploy the assemblies in this project. If the application already exists, the assemblies will be added to it when you deploy the project. If the application does not exist, the application will be created. If this field is blank, the assemblies will be deployed to the default BizTalk application in the current group. Names that include spaces must be enclosed in double quotation marks (“).
    • Configuration Database: Name of the BizTalk Management database for the group, BizTalkMgmtDb by default.
    • Server: Name of the SQL Server instance that hosts the BizTalk Management database on the local computer. In a single-computer installation, this is usually the name of the local computer.

Notice: If “Application Name” property is blank, the assemblies will be deployed to the default BizTalk application, i.e., “BizTalk Application 1”.

So if you have this problem, you may:

  • Inadvertently deployed it to another application, most likely to the default “BizTalk Application 1”;
  • Someone has probably removed the previously existing name in “Application Name” property from the project properties.

Solution

If “Application Name” property by mistake is blank, then this resource is already deployed in another application than the default: “BizTalk Application 1”, so we need to:

  • In the BizTalk Administration Console, the <All Artifacts> view will tell you in which application the resource is deployed, we need to find where this resource is deployed.
  • We need to fix the “Application Name” property.
  • Redeploy the project

If “Application Name” property isn’t blank, then the resource may inadvertently be deployed into another application, so we need to:

  • In the BizTalk Administration Console, the <All Artifacts> view will tell you in which application the resource is deployed, we need to find where this resource is deployed.
  • When you found the resource, delete it.
  • Redeploy the project

Working with Team Foundation Server 2010

In my case, it was really weird why this error was happening because I had been working on it a few days before and I knew that all settings were correct.

So to help my teammate and to see what was happening, I open Visual Studio get the last version of the project from TFS, because he had changed the solution, and I try to deploy the solution and to my astonishment, or not… everything worked fine, everything deployed successfully!

However, my colleague was still unable to properly deploy the solution… and it wasn’t permission problems.

So what happened?

Even though I have added the solution to TFS with the correct settings for Deployment… when another member opens this solution for the first time to work on it… the “Application Name” property is set to…. blank!!!!

Deployment options

We must go to all the projects in the solution and fix this property.

#1 Azure Monitoring Platform
Author: Sandro Pereira

Sandro Pereira lives in Portugal and works as a consultant at DevScope. In the past years, he has been working on implementing Integration scenarios both on-premises and cloud for various clients, each with different scenarios from a technical point of view, size, and criticality, using Microsoft Azure, Microsoft BizTalk Server and different technologies like AS2, EDI, RosettaNet, SAP, TIBCO etc. He is a regular blogger, international speaker, and technical reviewer of several BizTalk books all focused on Integration. He is also the author of the book “BizTalk Mapping Patterns & Best Practices”. He has been awarded MVP since 2011 for his contributions to the integration community.

7 thoughts on “Failed to add resource(s). Resource (…) is already in store and is either associated with another application or with another type.”

  1. This one is a common problem and unfortunately each developer will need to set the application name under the deployment tab for each build profile. This is because the application name (along with the database server) is stored in the .csproj.user file associated with each project which will not get checked into source control.

  2. Is there any way to automate the setting the Application name?

    On some of the large BizTalk solution we have, there can be more than 20 projects. Having to put the Application name in manually is rather time consuming.

    I tried looking into this using powershell but was not able to get anywhere.

Leave a Reply

Your email address will not be published. Required fields are marked *

turbo360

Back to Top