Adrian Melzer
Adrian Melzer

Reputation: 159

Getting Assembly Version of a class that implements interface through interface method

My classes all implement an interface. This interface stores some funtions for general functionality.

One of those funtionalities is Logging. In this Logging function I want to get the AssemblyVersion of the Class that implements the interface.

My problem is that Assembly.GetExectuingAssembly() will return the AssemblyVersion of the Interface.

How can I get the Assembly Version of the implementing class?

Upvotes: 0

Views: 135

Answers (1)

Rand Random
Rand Random

Reputation: 7440

This should work:

this.GetType().Assembly.GetName().Version

Upvotes: 1

Related Questions