5
votes

I have been trying to get Visual Studio Team Services to compile and build my MVC 5 C# project. But I kept receiving the error messages below consistently:

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 (7): 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 went through similar issue posted on stackoverflow and tried to apply the suggested solutions but none of them worked! I have no idea what else could fix this issue to try. I appreciate it if you could shed some lights on it. Thanks.

2
Can you post the contents of App_Start\BundleConfig.cs? - AutomationNation
Also try "Install-Package Microsoft.AspNet.Web.Optimization" from NuGet and make sure the DLL's are being copied to TFS - AutomationNation
New build system works with asp.net5 stuff: more available here: github.com/Microsoft/vso-agent-tasks hopefully helps - bryanmac
Any solution to this ever found? Going back to days of coping resources and checking them into TFS is not a solution. - RandallTo

2 Answers

1
votes

You need to ensure that Microsoft.AspNet.Web.Optimization and all of its dependencies are installed correctly.

Manage your Nuget Packages for the application and if it is showing as Installed, trying uninstalling and reinstalling it.

0
votes

I had to manually edit the .csproj for the project to fix the references, which were pointing to ../../OtherProject/packages/, committed and rebuilt, then the build succeeded.