Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there any difference in the binary image when compiling using C# 3.

Status
Not open for further replies.

DeveloperJr

Programmer
Mar 10, 2007
25
US
My understanding is that .NET 3.5 uses the 2.0 core. My question is, if I compile an assembly using C# compiler version 3.5, does it emit a different binary than 2.0 even if we didn’t change any code – only the compiler?
 
There will be minor differences in the compiled assembly, yes.

The major one would be that the assembly would now want v3.5 of the runtime installed.


____________________________________________________________________
www.chipholland.com
 
If you're using VS2008 you can set target framework to 2.0 though

[small]----signature below----[/small]
Majority rule don't work in mental institutions

My Crummy Web Page
 
That is true.

But even when targeting the v2.0 framework, there may be differences in the MSIL code that gets generated (the CLR team at MSFT may have learned more about creating optimized code in the 3 years since 2005 was released)

Chip H.


____________________________________________________________________
www.chipholland.com
 
Indeed. But as you pointed out, I think (hope) that the framework prerequisite is the big one :)

[small]----signature below----[/small]
Majority rule don't work in mental institutions

My Crummy Web Page
 
Thanks all for your feeback. Does anyone know a source I can use to read about the diffrences in the emited MSIL?

Thanks
 
I don't know of any published articles, sorry.

Probably the easiest way would be to compile some non-trivial code under VS.NET 2005 and 2008 (targeting the 2.0 framework), and then compare the generated MSIL using ILDASM or Reflector.

Chip H.



____________________________________________________________________
www.chipholland.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top