We have this very strange error in Asp.Net MVC 4 Razor whereby within the View, we have the following code:
@Html.InlineEditingContentText(CS.General_v4.Enums.HtmlTagName.Span, VisitGozo.Enums.VisitGozoEnums.ContentTextIdentifier.MasterPage_Weather_Title, "weather-widget-title masterpage-widget-title")
InlineEditingContentText is an extension method which we have internally. The 2nd parameter being passed is an enumeration parameter and as you can see from above, the value is VisitGozo.Enums.VisitGozoEnums.ContentTextIdentifier.MasterPage_Weather_Title. Now when you debug into the extension method InlineEditingContentText, the actual 2nd parameters being received is not VisitGozo.Enums.VisitGozoEnums.ContentTextIdentifier.MasterPage_Weather_Title but VisitGozo.Enums.VisitGozoEnums.ContentTextIdentifier.MasterPage_Header_LoggedOutText which happens to be the next value of the ContentTextIdentifier enumeration after VisitGozo.Enums.VisitGozoEnums.ContentTextIdentifier.MasterPage_Weather_Title.
We are not assigning values to the enumerations and so their respective int values increment after each other automatically.
- Strangely enough, if we load the exact same project on another workstation, this works fine.
- Also, if we perform some changes to the View (like just add a whitespace) and save, this also works fine.
Any possible insight into why this strange issue is happening?
Edit #1: Also, when we uploaded the website on the deployment server, after compiling using same workstation, the error was carried over as well
Edit #2: 2013-10-22 > We are still getting this same problem, even when then deploying the files on the actual production server, such incorrect enum values are being carried over. The only way to solve the issue is to delete the Views from the server / locally, and re-overwriting them again. Any idea how we can solve this issue? We shouldn't be caching Views so can't really understand why this is happening? Would appreciate any form of help!