0

I was looking through the code for Entity Framework.

I noticed that the production dll for entity framework 5 has some SuppressMessage attributes in it still

enter image description here

Even though the project is obviously built with the CODE_ANALYSIS compilation symbol (if you look at the open source project) to remove SuppressMessage attributes, it's still there in some cases.

Isn't this just adding to the size of the dll (I know there isn't a runtime performance hit since it's all just metadata) But why are only some parsed out? There are thousands that didn't end up in the production DLL.

Also I decompiled the version you get from NuGet just to be sure I wasn't building the project with the wrong settings.

I'm using the EF codebase as my example because I can't even get the CODE_ANALYSIS compilation symbol to remove my own suppressmessages even when I compile for release

Brian Rosamilia
  • 1,448
  • 14
  • 24
  • 1
    Testing on my system, the `SuppressMessage` attribute is emitted into the il if you have compiled with the `CODE_ANALYSIS` compilation symbol set. If you have the attribute in the code, but not the compilation symbol, it is not emitted. – adrianbanks Feb 24 '13 at 21:59
  • That is interesting. I thought it was the reverse; my mistake. Still doesn't account for the huge discrepency in the EF project. If you take a quick look it has 2,000+ suppressions in the DLL and only a scattered few in the real production assembly. I'm just wondering how it happened. – Brian Rosamilia Feb 24 '13 at 22:05

0 Answers0