I'm making an ASP .NET project using MVC, I've been having a recurring glitch in visual studio when I try debugging recently added code, when I add a breakpoint to a method in which I have added new code and I try debugging that method, the debugger skips the new code and only debugs the old code. It's like the code stayed in an older version and visual studio won't detect new code. Any idea what this might be?
This is a method in which I have added new code as an example:
public ActionResult EnviarCorreo()
{
bool num;
num = false;
if (num == true)
{
clsCotizacion ObjCotizacion = new clsCotizacion();
ViewBag.Lista = ObjCotizacion.ConsultaCorreoProveedor().ToList();
return View();
}
return View("Index");
}
The new code is:
bool num;
num = false;
if (num == true)
{
//the code inside this if is old
}
return View("Index");
As you can see, if this were to be executed, the method wouldn't be able to run the code inside "if (num == true)" because I've set the value of num to false, yet the code is still executed because visualstudio skips the newly added code, so it jumps straight to "clsCotizacion ObjCotizacion = new clsCotizacion();". I should also mention that when debugging step by step, the positions of the lines of the debugger are still the same as the ones in the old method.