473,396 Members | 2,003 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 1554
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 StandardModuleAttribute). 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 StandardModuleAttribute).
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__Weiss" <lf*@airmail.netwrote in message
news:ea**************@TK2MSFTNGP06.phx.gbl...
Can a C# program find out what language an assembly (or components
thereof) is written in?

- Larry
Sep 21 '08 #4
"Larry__Weiss" <lf*@airmail.netwrote in message
news:uz**************@TK2MSFTNGP02.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 "syntactical 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****@community.nospamwrote in message
news:%2****************@TK2MSFTNGP02.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
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
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 ...
3
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...
7
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??...
1
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...
63
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...
13
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,...
2
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.