473,545 Members | 1,924 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can a C# program find out what language an assembly is written in?

Can a C# program find out what language an assembly (or components
thereof) is written in?

- Larry
Sep 21 '08 #1
5 1575
Larry__Weiss wrote:
Can a C# program find out what language an assembly (or components
thereof) is written in?
All assemblies are written in IL.

Or to put it differently, it's impossible to do this with any sort of
reliability. You can guess at it heuristically: for example, all assemblies
compiled with the C# compiler will have a private "<Module>" class; those
compiled with the VB.NET compiler will not (they have other telltale signs,
like having a class with a StandardModuleA ttribute). However, drawing
conclusions from this is dubious at best, and it would be hitting a moving
target.

--
J.
Sep 21 '08 #2
Jeroen Mostert wrote:
Larry__Weiss wrote:
>Can a C# program find out what language an assembly (or components
thereof) is written in?
All assemblies are written in IL.

Or to put it differently, it's impossible to do this with any sort of
reliability. You can guess at it heuristically: for example, all
assemblies compiled with the C# compiler will have a private "<Module>"
class; those compiled with the VB.NET compiler will not (they have other
telltale signs, like having a class with a StandardModuleA ttribute).
However, drawing conclusions from this is dubious at best, and it would
be hitting a moving target.
To dig a little deeper, why are there currently those telltale heuristic
differences? Do they indicate any basic differences in what can be
implemented in C# compared to what can be implemented with VB.NET ?

- Larry
Sep 21 '08 #3
Look at "Reflector" by searching the net. It can dissassemble an exe or dll
to VB, C#, C++, Delphi, Chrome, or show the IL. It isn't directly related
to your question, but, this tool doesn't try and tell me what the language
used for an assembly originally was.

"Larry__Wei ss" <lf*@airmail.ne twrote in message
news:ea******** ******@TK2MSFTN GP06.phx.gbl...
Can a C# program find out what language an assembly (or components
thereof) is written in?

- Larry
Sep 21 '08 #4
"Larry__Wei ss" <lf*@airmail.ne twrote in message
news:uz******** ******@TK2MSFTN GP02.phx.gbl...
To dig a little deeper, why are there currently those telltale heuristic
differences? Do they indicate any basic differences in what can be
implemented in C# compared to what can be implemented with VB.NET ?
More than anything, the differences simply reflect (no pun intended) the
design choices made by the programmer teams that implemented the languages.

This also applies to certain syntax differences between, say, C# and VB as
the two most well-known languages hosted on top of IL. The designers of VB
gave their users certain kinds of "syntactica l sugar" that the C# designers
didn't think of or perhaps didn't think would be useful or worth the
trouble. The C# team, on their side, did the same thing with features that
VB doesn't happen to have (the 'using' statement springs to mind).

Neither of these sets of differences represent limitations of what the
languages could in principle be made to do. IL has quite a bit more
capability than has been exposed in either language.

Tom Dacon
Dacon Software Consulting
Sep 21 '08 #5
"Tom Dacon" <td****@communi ty.nospamwrote in message
news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
The C# team, on their side, did the same thing with features that VB
doesn't happen to have (the 'using' statement springs to mind).
VB.NET has had a "Using" statement since v2.
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Sep 22 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
8729
by: vronskij | last post by:
Hi, A C program can be hundreds of thousands lines of code big. C++ millions. How about Python? Suppose , you are a sole programmer (lonewolf). How many lines can one handle? Thanks,
22
3580
by: edgrsprj | last post by:
PROPOSED EARTHQUAKE FORECASTING COMPUTER PROGRAM DEVELOPMENT EFFORT Posted July 11, 2005 My main earthquake forecasting Web page is: http://www.freewebz.com/eq-forecasting/Data.html Newsgroup Readers: If you circulate copies of this report to groups of computer programmers at different universities etc. around the world then they might...
3
39358
by: James | last post by:
Im having trouble building/running a program which was written under Visual Studio 2000 & .NET Framework 1.0. Im now using a new installation of .NET 1.1 with Visual Studio 2003, otherwise there have been no changes to the code. Although there appears to be no build errors, the program terminates almost as soon as it has begun with the debug...
7
1518
by: Milk | last post by:
Anyone can help me to do this program, i will pay for it coz i really don't have time to do it and i need hand it in 22/04. Pls help me and reply about how much u want i pay for this program?? thanks a lot Here is the Question:: Improve the following (badly written) matrix multiplicationprogram and translate it into MIPs assembly language...
1
4940
by: Sandeep | last post by:
Hi, I want to read & print a UTF-8 encoded characters stored in a file. I want to write a C program on Linux platform to achieve this. I am new to UTF-8. I will appreciate any sample programs OR guidance on this. Thanks in advance,
63
15197
by: biyubi | last post by:
Hi, a year ago I won the 2005 Best Game categoryof the International Obfuscated C Code Contestwith a chess program. http://www.ioccc.org/whowon2005.html http://www.mailcom.com/ioccc/toledo/hint.htmBut this post is because I have discovered (asurprise for me) that it is also the worldsmallest chess program written in C language.It has a size...
13
2188
by: VijayJaiswal | last post by:
How can i make and execute assembelly language programes in c language. I have not make a single assembelly program yet, so please give a small example. Also mension all the instructions necessary, so that i can make and execute assembely language programme on c compiler.
2
2007
by: Jan Althaus | last post by:
Mostly for testing reasons I'd like to see if it makes sense to chose the following approach for just-in-time compilation of shaders for a renderer: Seeing as the shaders themsefs consist mostly of very basic operations I'd like to translate them into assembly, have an assembler compile the binary code and then call the resulting machine code...
0
7478
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7668
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7923
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7437
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5343
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4960
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1901
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1025
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.