简体   繁体   中英

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.

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.

我不得不手动编辑项目的.csproj以修复引用,这些引用指向../../OtherProject/packages/ ,已提交并重建,然后构建成功。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM