I have a build process on Azure DevOps that I have been building successfully for awhile now.
Recently one of my developer added a page that contains the MVC library
using System.Web.Mvc
However, the build keeps failing now when I build it via the Azure DevOps build agent as part of our CI/CD process.
ClassName.cs(5,18): Error CS0234: The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)
It compiles if I compile manually using Visual Studio 2017 on my own laptop or if I use the Visual Studio 2017 on the build machine where the Azure DevOps build agent runs.
The steps that I've tried to troubleshoot:
- Ensure in my Project's NuGet, that I have Microsoft.Aspnet.MVC latest vesrion.
- I've tried to reinstall Microsoft.Aspnet.MVC on the build
machine through NuGet - I verified my project' default package
management format is : Packages.config - I verified that my packages.config has < package id="Microsoft.AspNet.Mvc" version="5.2.7" targetFramework="net472" />
- I tried to reinstall all the package on my build machine by running Update-Package --reinstall command.
- I verified that on the build agent machine I have the Microsoft.AspNet.Mvc folder and all of its dlls under repositoryPath -
$(Solutiondir)/packages and globalPackagesFolder -
$(UserProfile).nuget\packages
I'm running out of idea on why it compiles on Visual Studio manually but has error when I compile using the build agent through MS Build on x64 bits.