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?
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.
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.
See my blog C# Bits | Twitter @sjnaughton Always seeking an elegant solution.
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)
zwitterion
Member
46 Points
66 Posts
UIHint attribute randomly lost at runtime - metadata bug
Jul 24, 2012 09:43 AM|LINK
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
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.
DynamicData ComponentModel metadata uihint controlparameters mvc EntityFramework
sjnaughton
All-Star
27308 Points
5458 Posts
MVP
Re: UIHint attribute randomly lost at runtime - metadata bug
Jul 25, 2012 02:56 PM|LINK
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.
Always seeking an elegant solution.
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: UIHint attribute randomly lost at runtime - metadata bug
Jul 26, 2012 01:00 AM|LINK
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!
zwitterion
Member
46 Points
66 Posts
Re: UIHint attribute randomly lost at runtime - metadata bug
Jul 27, 2012 04:19 AM|LINK
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)
gtscdsi
Member
250 Points
50 Posts
Re: UIHint attribute randomly lost at runtime - metadata bug
Jul 31, 2012 07:37 AM|LINK
can you add trace to your assembly and monitor on it?
http://blogs.msdn.com/b/asiatech/