CIL (Common Intermediate Language) is a low-level language used by Microsoft .NET Framework and Mono.
Questions tagged [il]
477 questions
0
votes
1 answer
Disassembled and reassembled DLLs won't resolve mutual references
I'm trying to sign a set of DLLs through this process:
ildasm the original DLL to IL
ilasm (and Strong Naming) the IL back to DLL
Each of the DLLs, seen thorugh Visual Studio Object Browser, is correct, but if a rebuilt DLL refers to an object…

Andrea Colleoni
- 5,919
- 3
- 30
- 49
0
votes
1 answer
How to invoke Nullable.HasValue in DynamicMethod?
I'm writing some code using DynamicMethod. Inside my DynamicMethod, I want to invoke the Nullable.HasValue (and also the Nullable.Value) properties. I've written some code to do some, but I keep getting the Operation could destabilize the runtime…

Vivian River
- 31,198
- 62
- 198
- 313
0
votes
1 answer
Access related member with IL Emit
how can I write this C# method
public bool CheckIsLocal()
{
return HttpContext.Current.Request.IsLocal;
}
using C# Reflection.Emit?
this method is just a example, my intention is discover how to write code to access related members using C#…

LuigleDR
- 309
- 1
- 2
- 13
0
votes
0 answers
Is there a way to turn fixed length arguments in to an __arglist when using IL?
This is my first time using IL, I'm creating a kind of transparent proxy. The code works but there are a few bits that I would like to improve. The first is that when I intercept a method it can have any number or type of arguments. Ideally I'd like…

JoeS
- 1,405
- 17
- 30
0
votes
1 answer
readline function in .net assembler
I'm trying to figure il code out, but cannot understand why next code crashed. When I use the same code without next row:call string [mscorlib]System.Console::ReadLine() code behavior are expected, but adding above described row force crash. What's…

user2201747
- 159
- 1
- 2
- 9
0
votes
1 answer
Does compiler optimizes unnecessary/redundant upcast away or Does it produce any IL at all?
From Do redundant casts get optimized? I can see compiler doesn't optimizes unnecessary downcast (i.e. castclass) away. But now I am interested in a simpler case, " if compiler optimizes unnecessary upcast away?" This question only concerns…

colinfang
- 20,909
- 19
- 90
- 173
0
votes
1 answer
How can I change my applicatoin resource without source rebuilding?
I develop a .net application many years ago.
My customer wants to making some simple changes on application.
But I lost my codes?
Is there any solution to modifying some resources in my application?

Deviser
- 95
- 1
- 9
0
votes
2 answers
Dynamically change namespace and assembly name
Basically, I developped a small library with some common fonctionnalities that I use in all my projects. For some political reasons, I cannot choose a generic name for that library (including namespace and assembly name). Usually, it must include…

Bidou
- 7,378
- 9
- 47
- 70
0
votes
1 answer
Is IL performance related to its code size?
When looking at intermediate language, each instruction has a particular byte size.
If I have a method with a total code size (the sum of instructions sizes) of 10 bytes and a method with a total code size of 20 bytes, can I presume that the first…

Jaanus Varus
- 3,508
- 3
- 31
- 49
0
votes
1 answer
Calling a method on a field
I'm just curious on how I would call a method on a field using Emit.
I have this class generated
public class AClass : IDynamicProxyTestInterface
{
private DynamicProxy proxy;
public…

Kelly Elton
- 4,373
- 10
- 53
- 97
0
votes
0 answers
Trim unreachable code from Assembly
Possible Duplicate:
How does the number of classes in an assembly impact performance?
I have a fairly large .Net assembly containing common controls and components. This the VS project file is used in several different VS solutions. Any given…

Daniel Radford
- 11
- 3
0
votes
1 answer
Access Violation with Dynamic Method, only when Running 32 Bit
I have the following code for creating a dynamic method to call the Set method of a property in my VB.net app, using .NET 3.5 (can't switch to the Lambda expression style). Using an the example posted here, I added to the function because it did not…

Kratz
- 4,280
- 3
- 32
- 55
0
votes
1 answer
Am I hurting the performance of my application by weaving IL code as IL_9999?
I was messing around my IL code inside of my dll file (just for learning purposes). I wanted to see what would happen if I injected my own IL code, for example... I threw in a box call: IL_9999: box !T. I'm wondering if the offset value actually…

myermian
- 31,823
- 24
- 123
- 215
0
votes
3 answers
Simple VB code is not running
I made a simple example in VB.net, compiled it, and run it:
Public Class Application
Sub calc1()
Dim sq as Integer
'uncommenting this loop keeps it from compiling for some reason
'For i as Integer = 1 to 1000
' …

NoBugs
- 9,310
- 13
- 80
- 146
0
votes
1 answer
Live IL Viewing of the typing code
Is there any tool that make it possible as we write CS Code (.Net Code) show us the equivalent IL Version of it,
Needed such a tool as learning purpose.
In one side we write sample code :
e.g: (Just as an example)
We write :
if…

Kasrak
- 1,509
- 4
- 24
- 48