How to access assembly version and name from assembly / WCF service?

I would like to provide a contract to work in my WCF library, which returns the selected information, that is, version, assembly name, some other internal values.

The goal is to provide a "Service Check" method for diagnostics and one that can be called like a regular WCF.

It’s hard for me to figure out how to do this. I imagine some kind of internal reflection.

I would also like to put this code in the interface as part of the operation contract.

What is the best way to do this?

+4
source share
1 answer

You can do this using reflection:

For example, to get assembly version information:

return System.Reflection.Assembly.GetExecutingAssembly().GetName().Version 
+8
source

Source: https://habr.com/ru/post/1484898/


All Articles