c# - Unable to load System.Data.Linq.dll for CodeDom -


i trying dynamicaly compile code using codedom. can load other assemblies, cannot load system.data.linq.dll. error:

metadata file 'system.data.linq.dll' not found

my code looks like:

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"); 

any ideas?

that may because assembly stored in different location mscorlib is. should work if provide full path assembly. convenient way full path let .net loader work you. try this:

compilerparams.referencedassemblies.add(typeof(datacontext).assembly.location); 

Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -