Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to determine what language a .NET assembly was written in?

Tags:

.net

Is there a method to determine the original language of a .NET assembly if the source code is not available?

like image 218
kbrimington Avatar asked Dec 22 '22 00:12

kbrimington


1 Answers

Not really, but you can sometimes make a guess.

For example, if you have a VB.NET assembly containing anonymous types, the compiler-generated name in the assembly will look something like this:

VB$AnonymousType_T<T0, T1>

Anonymous types in a C# assembly look like this:

<>f__AnonymousType0<....>

Different compilers will implement these sorts of things slightly different. C++/CLI assemblies tend to have lots of types in the assembly with "funny" names (for things like functions that belong to the global scope and so on).

Visual Basic applications also reference the Microsoft.VisualBase assembly (though any .NET app can technically reference any assembly, so that's not a 100% indicator).

like image 116
Dean Harding Avatar answered Mar 09 '23 00:03

Dean Harding