kosay85 wrote:
I give windows API as an example to use external dll files . in general how I can use dll files with CodeDOM ??
This is how
https://msdn.microsoft.com/en-us/library/system.codedom.compiler.compilerparameters%28v=vs.110%29.aspx[
^],
https://msdn.microsoft.com/en-us/library/system.codedom.compiler.compilerparameters.compilerparameters%28v=vs.110%29.aspx[
^].
For the constructors with arguments, first one is the array of referenced assembly names.
To see where
CompilerParameters
come into play, please see the code sample on this MDSN page and read the whole overview:
https://msdn.microsoft.com/en-us/library/saf5ce06%28v=vs.110%29.aspx[
^].
There are two important things: 1) you never need to use P/Invoke (from "kernel32.dll" or anything else); CodeDOM gives you everything to compile assemblies and a lot more; using P/Invoke only can compromise your platform compatibility, so use it only in special need; 2) with .NET, you should not think in terms of DLLs, the central concept is assembly which can use one or more
modules; a DLL is one of the modules; there is no fundamental difference between EXE, DLL or anything else (EXE also has an entry point, so what?); it's just different file naming patterns.
—SA