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 in BizTalk
Tags: , ,

One of my team members that is 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 by 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 have 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 were 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 been deployed in to 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 were this resource is deployed.
  • When found 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 open 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.

About these ads
Comments
  1. Cesar Augusto Lopez Amaya says:

    Good post!!!

  2. Johann says:

    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.

  3. Matt Corr says:

    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

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