locked
UIHint attribute randomly lost at runtime - metadata bug RRS feed

  • Question

  • User-2013179010 posted

    We've had a really troubling bug show up twice now - once on a dev machine and once on production - where a UIHint attribute applied in a metadata class won't be applied to the MetaColumn for the life of the application.

    The entity and metadata classes are in a separate assembly, and are loaded into the site and a few other services. Everything works fine, including metadata attributes for all other entitysets, but custom metadata for one column just wasn't there 

    Column.Attributes.OfType<UIHint>().Count //=> 0

    On the dev machine this problem persisted through a few rebuilds, but as no other machine exhibited it for the same project we decided it was a weird config glitch we'd get back to later. However now the same symptoms are showing up on prod (for a different column / table.)

    We fixed it on prod by forcing an app restart but obviously we can't go through the site every time we deploy and check for missing UIHint attributes.

    This is an especially difficult bug to trap because it seems impossible to reliably reproduce. Can anyone with a better knowledge of .net suggest ways we could isolate it?

    (Using DynamicData 4, Entity Framework 4, .net framework 4 fwiw)

    Update: this is now happening on production semi-regularly. Each time, forcing an app restart solves it, but it comes back after an unknown amount of time. We're doing some automated monitoring to try and pin down the time frame at least.

    Tuesday, July 24, 2012 5:43 AM

All replies

  • User-330204900 posted

    Hi zwitterion, I have not seen this ever and I have created dozens LOB apps using DD I can only assume it somtnhing to do with the seperate assembly as that is the only thin you have different from my set up. it may be worth while cleaning out the bin and obj folder then doing a redeply when you can have the site down. I have had weired issues where is seems I was not getting some of my latest assemblies and this was a good fix.

    Wednesday, July 25, 2012 10:56 AM
  • User3866881 posted

    Hi,

    Do you mean that when you entitle some public property with UIHint, and it doesn't work or you cannot see the UIHint attribute?

    Reguards!

    Wednesday, July 25, 2012 9:00 PM
  • User-2013179010 posted

    That's right, we tag a property with a UIHint in a metadata class in an assembly that gets loaded into the site, and sometimes that UIHintAttribute doesn't show up on that property at runtime. Restarting the app sometimes fixes the problem, and interestingly it seems to repeatedly happen on the same property (metadata of all other properties of all other classes will be fine)

    Friday, July 27, 2012 12:19 AM
  • User1104055534 posted

    can you add trace to your assembly and monitor on it?

    Tuesday, July 31, 2012 3:37 AM