c# - CodeDom Compiler: Which assemblies are referenced by default? -
short: assemblies (framework dlls) included default in .net codedom compilers (csharpcodeprovider
or vbcodeprovider
) without explicitely adding reference compilerparameters?
i using codedom
tools, namely csharpcodeprovider
, vbcodeprovider
, compile assemblies @ runtime. noticed, not .net reference assemblies included default.
i can use in system.dll
without adding reference in compilerparameters
nothing system.numerics.dll
example. latter need add params.referencedassemblies.add("system.numerics.dll")
code.
hence question: how know, assemblies referenced default, , not?
relevant code:
this code can compiled without added references:
imports system public class foo public sub testclass dim t = tuple.create(23,241) end sub end class
this code can not:
imports system imports system.numerics public class foo public sub testclass dim t = tuple.create(23,241) dim n new complex(32,112) end sub end class
the code use compile (abbreviated):
dim params new compilerparameters() 'the path of assembly create params.outputassembly = active.outputname 'compile dll params.generateexecutable = false dim vb new vbcodeprovider dim res = vb.compileassemblyfromsource(params, active.code)
Comments
Post a Comment