C# Dll in a non dot net environment

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is it possible to use a c# dll in an environment where the dot net framework has not been installed ?

For example will a C++ wrapper do the job?

Thanks.
DD
 
No to both questions.
Think of this; even the simplest C# DLL needs the CLR and call's methods
implemented in the framework classes, how would this possibly work without
it?

Willy.
 
However it can be used from a non-.NET client, such as VB6, by making it a COM object. How though, I don't know.
 
Beeeeeeeeeves said:
However it can be used from a non-.NET client, such as VB6, by making
it a COM object. How though, I don't know.

Yes, but the answer is the same. Interop will provide a wrapper letting
the client think that it is working with a COM object but behind the
scenes, you'll still have .Net code running, and you'll still need the
CLR.
 
Beeeeeeeeeves said:
However it can be used from a non-.NET client, such as VB6, by making it a
COM object. How though, I don't know.

You don't make it a COM object, the CLR presents it as a COM object to the
client through a CCW (Com Callable Wrapper).

Willy.
 
Nope. Basically there are 2 reasons.
1. C# dll is not compiled to native code. Rather it is compiled to IL (Intermediate language). .Net framework compiles the IL to native at the runtme.

2. C# dlls PE file structure is not same as the native PE file structure.

Hope this helps

Buddhike de Silva (www.buddhike.net)
 
Back
Top