1

I have solution that contains multiple projects. Within each project, the Properties folder contains three files:

  1. AssemblyInfo.cs
  2. AssemblyVersionInfo.cs (as a link)
  3. SharedAssemblyInfo.cs (as a link)

This allows me to share the assembly information across each of the projects in the solution.

SharedAssemblyInfo.cs contains a reference to [assembly: CLSCompliant(true)].

I am having an issue with duplicate entries.

For example, Project A inherits [assembly: CLSCompliant(true)]. However, Project B needs to override the default setting. Project B needs to set [assembly: CLSCompliant(false)].

Is there way Project B can check for the existence of a setting? If found, then modify the current value.

Thanks.

Steve

Steve
  • 927
  • 3
  • 10
  • 23

1 Answers1

1

i assume you are lloking for a way to read assembly attributes... you can do this using reflection, here are some link:

i never done this on assembly, but they are all refer to a type, and that type may or may not have attributes, if there are any, you should check their types, and then read their values.

https://msdn.microsoft.com/en-us/library/y1375e30%28v=vs.110%29.aspx

How to read assembly attributes

Community
  • 1
  • 1
Hassan Faghihi
  • 1,888
  • 1
  • 37
  • 55
  • #deadManN, your links gave me the answer I was looking for. thanks. – Steve Jan 29 '16 at 12:37
  • they are all the same. you get your type and do the requred, but for some things, like instance data, private data, or other things, you also should do add several flags, for example if you want to get a data from a field of the class, you need to combine Instance and Private flag using pipe sign '|' and get the property, then call get value on that property and pass it the instance of the class. – Hassan Faghihi Jan 29 '16 at 15:42