0

I got the following view model

public enum EnumViewModel
{
    [Display(Name = "Foo")]
    First,

    [Display(Name = "Bar")]
    Another
}

With this view

@Html.DisplayFor(model => model.ProjectStatus)

Locally it displays Foo as expected.

However when I publish it displays: First.

I cannot figure out why.

Update

If I use this approach it works both locally and when published. But I'm not looking for a workaround. So I'd still like to know what's causing this odd issue.

Community
  • 1
  • 1
Snæbjørn
  • 10,322
  • 14
  • 65
  • 124
  • 1
    How are you publishing? Have you definitely replaced all the old DLLs with the new ones? – Basic Mar 29 '16 at 13:39
  • I publish using Web Deploy and the publish profile is set to delete everything on the host before uploading – Snæbjørn Mar 29 '16 at 13:45
  • Have you tried [this answer](http://stackoverflow.com/a/24406117/4270650)? – Will Ray Mar 29 '16 at 15:47
  • Nifty solution. But I'm not looking for a workaround. I'd like to know why it doesn't work as expected. Is it a known bug? Is something missing on the server? – Snæbjørn Mar 29 '16 at 16:10
  • This is nit-picky, but what happens if you use the `[DisplayName]` attribute instead? – JB06 Mar 30 '16 at 17:50
  • I'll give that a try. But the deploy process is a bit troublesome so it'll take a few days :( – Snæbjørn Mar 31 '16 at 11:54

0 Answers0