我正在尝试使用 CodeDom 动态编译代码。我可以加载其他程序集,但无法加载 System.Data.Linq.dll。我收到一个错误:
找不到元数据文件“System.Data.Linq.dll”
我的代码如下所示:
CompilerParameters compilerParams = new CompilerParameters();
compilerParams.CompilerOptions = "/target:library /optimize";
compilerParams.GenerateExecutable = false;
compilerParams.GenerateInMemory = true;
compilerParams.IncludeDebugInformation = false;
compilerParams.ReferencedAssemblies.Add("mscorlib.dll");
compilerParams.ReferencedAssemblies.Add("System.dll");
compilerParams.ReferencedAssemblies.Add("System.Data.Linq.dll");
有任何想法吗?