1

I am getting below error during tfs build.

The type or namespace name 'Practices' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)

Though its working good on a specific tfs agent (another one).

Here my requirement is not to use that TFS agent.

Can anyone suggest, what microsoft package should i install on the agent to fix the build issue.

Assistance will be highly appreciated.

Thanx.

DanB
  • 2,022
  • 1
  • 12
  • 24
andie
  • 11
  • 1
  • 2
  • It depends on what class you're trying to use from that namespace... Normally, 'Microsoft.Practices' is part of the [Enterprise Library](https://msdn.microsoft.com/en-us/library/ff648951.aspx). – rickvdbosch Feb 05 '18 at 08:37
  • @RickvandenBosch Thank you for the quick response. Actually my role is devops. not too much idea on coding. Can you please guide what should i do exactly to fix this. Thanks. – andie Feb 05 '18 at 08:59
  • If we don't know which assembly it actually is, we can't help you. There are several of them. Have a look in the code and see which `using` statements there are. – rickvdbosch Feb 05 '18 at 09:28
  • @RickvandenBosch using Microsoft.Practices.EnterpriseLibrary.Data – andie Feb 05 '18 at 09:39
  • Then you're probably missing the [`Enterprise Library - Data Access Application Block`](https://www.nuget.org/packages/EnterpriseLibrary.Data/) – rickvdbosch Feb 05 '18 at 10:47
  • @andie Which version of TFS do you use? Have you added Nuget step to restore the packages in your build definition? Can the build server (tfs agent ) access the network? – Andy Li-MSFT Feb 06 '18 at 02:39

1 Answers1

0

Please try below items to narrow down the issue:

  1. Check if you added the Nuget task to restore the packages in you build definition.
  2. Make sure the build server can access the internet or the specific Nuget server to restore the packages.
  3. Analyse the build logs from the worked agent and the failed agent, to check where the referenced assemblies from. Compare the logs to get the key point. Debug it.
  4. Based on your clarification, the missed assemblies should be belongs to EnterpriseLibrary.Data. So, you can also try to install it manually or add a copy step to copy it to the correct path on the agent machine.
  5. Remove the references from your project, then add the references again, make sure that your project is referencing to :

    • Microsoft.Practices.EnterpriseLibrary.Common
    • Microsoft.Practices.EnterpriseLibrary.Data

    Then Check in the changes.

Reference this similar thread : The type or namespace name 'Practices' does not exist in the namespace 'Microsoft'

Andy Li-MSFT
  • 28,712
  • 2
  • 33
  • 55