C# (Sharp) Programming Language Question:

Download Job Interview Questions and Answers PDF

How do you specify a custom attribute for the entire assembly (rather than for a class)?

C# (Sharp) Programming Language Interview Question
C# (Sharp) Programming Language Interview Question

Answer:

Global attributes must appear after any top-level using clauses and before the first type or namespace declarations. An example of this is as follows:
using System;
[assembly : MyAttributeClass]
class X {}
Note that in an IDE-created project, by convention, these attributes are placed in
AssemblyInfo.cs.

Download C# (Sharp) Programming Language Interview Questions And Answers PDF

Previous QuestionNext Question
What is the .NET datatype that allows the retrieval of data by a unique key?What is the difference between a Struct and a Class?