Break points are not hitting for the new method with the same name. Old one being commented out

Topics: Core, Customizing Orchard
Aug 21, 2013 at 5:50 AM
Can anybody help me? I am in strange problem - don't know how to get out of this :(

I commented out a method in my Controller
[Themed]
public ActionResult DisplayAll(PagerParameters pagerParameters = null), which was [Themed]

and created a new one with different parameters like:
public ActionResult DisplayAll(string subjectPath, int currentPage, int defaultPageSize), which is NOT [Themed]

I put a trace in the method and run the page in Debug mode (of course after resetting IIS).

The break point is never being recognized and I am allowed to do a line by line debug. Also though the new method is not Themed, it is sending back data as Themed.

Badly need to be helped out!
Developer
Aug 21, 2013 at 9:40 AM
Uhm this is strange. My first guess would be that your new code wasn't compiled, because you're using Orchard 1.6 where dynamic compilation is broken so even an IIS reset won't help. Is this the case?
Aug 21, 2013 at 2:45 PM
You might have missed to comment out [Themed] attribute of the method that's commented out, and if the new method is placed after the old one, it might be affecting. Even if it's commented out, you might delete (or put a white space in, ie. [The med]) if the parser is being silly.

Can't guess why debug is not working.


Aug 21, 2013 at 2:54 PM
Piedone wrote:
Uhm this is strange. My first guess would be that your new code wasn't compiled, because you're using Orchard 1.6 where dynamic compilation is broken so even an IIS reset won't help. Is this the case?
I am using Orchard 1.7, so that is not the case I hope
Aug 21, 2013 at 2:58 PM
kassobasi wrote:
You might have missed to comment out [Themed] attribute of the method that's commented out, and if the new method is placed after the old one, it might be affecting. Even if it's commented out, you might delete (or put a white space in, ie. [The med]) if the parser is being silly. Can't guess why debug is not working.
Hi kassobasi,,

I completely removed the method along with [Themed] attribute. But why the break point won't hit in debug mode. It seems like some previous configuration has been set into the last compiled version when the old method was there with [Themed] attribute! Not sure, but if this is the case how can I fight with this? Please advice. I am in real trouble here :(
Aug 21, 2013 at 7:56 PM
Ok, I finally figured it out! The priority factor in Route. The URL pattern was matching with another one partially but it has a higher priority set! I put a break point in that method and it got hit. Wow - what a silly mistake I did :)