Rafal_Koscinski
Rafal_Koscinski

Reputation: 317

Why am I missing a reference?

When I'm building in TFS I have something like this:

App_Start\BundleConfig.cs (2): The type or namespace name 'Optimization' does not exist 
in the namespace 'System.Web' (are you missing an assembly reference?)  

Global.asax.cs (3): The type or namespace name 'Optimization' does not exist in the 
namespace 'System.Web' (are you missing an assembly reference?)

App_Start\BundleConfig.cs (9): The type or namespace name 'BundleCollection' could not be 
found (are you missing a using directive or an assembly reference?)

I've already looked through this links:

http://docs.nuget.org/docs/workflows/using-nuget-without-committing-packages

http://docs.nuget.org/docs/reference/package-restore-with-team-build

But nothing seems to help :/ On my local copy everything build and runs ok. I'm googling for any solution but nothing seems to help. I have also deleted the packages folder so that TFS could download it (at least that what I have found on the net) but this doesn't help either. I'm running out of ideas. Thanks.

Upvotes: 1

Views: 1440

Answers (2)

Rafal_Koscinski
Rafal_Koscinski

Reputation: 317

Ok I think I should write you that I have fixed the problem.

It seems that in the package folder in the solution the dll's were missing. I've added the items to the packages foleder. In fact I did it last time but it also did not help. But today i've noticed that the libraries that my app was looking for were EXCLUDED from the check in. I don't know why but I've included everything what has excluded. Going by path that Babak Naffas i had the problem probably with the fact that on the build server there is .net 4.0 installed. So i've also changed the traget framework attribute from net45 to net40. Now it's building :)

Upvotes: 0

Babak Naffas
Babak Naffas

Reputation: 12561

Search the build logs and confirm that the build process is downloading the missing NuGet packages.

Also verify that your build machine has .NET 4.5 installed. Judging by the MSDN page for the namespace System.Web.Optimization, the package only supports .NET 4.5 and above.

Upvotes: 2

Related Questions