Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MVC 5 build failing on Visual Studio Team Services

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.

like image 638
Arash Avatar asked Nov 09 '22 18:11

Arash


1 Answers

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.

like image 169
Derek Avatar answered Nov 15 '22 06:11

Derek