---
title: "How do you specify a custom attribute for the entire assembly (rather than for a class)?"  
description: "How do you specify a custom attribute for the entire assembly (rather than for a class)?"  
author: "Varun Agrawal"  
published: 2011-03-18  
updated: 2020-09-22  
canonical: https://www.mindstick.com/interview/492/how-do-you-specify-a-custom-attribute-for-the-entire-assembly-rather-than-for-a-class  
category: "assembly"  
tags: ["assembly"]  
reading_time: 1 minute  

---

# How do you specify a custom attribute for the entire assembly (rather than for a class)?

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.

## Answers

### Answer by Varun Agrawal

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.


---

Original Source: https://www.mindstick.com/interview/492/how-do-you-specify-a-custom-attribute-for-the-entire-assembly-rather-than-for-a-class

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
