c# - Why I can't add .NET DLLs at run time -


using codedom have this:

compilerparameters parameters = new compilerparameters(); parameters.referencedassemblies.add("system.dll"); parameters.referencedassemblies.add("system.windows.forms.dll"); parameters.referencedassemblies.add("system.data.linq.dll"); parameters.referencedassemblies.add("system.xml.linq.dll"); parameters.referencedassemblies.add("system.core.dll"); 

and when run program, the error last 3 dlls, first 2 (system.dll , system.windows.forms.dll ) have no problem , error add last 3 lines load dlls too, errors 1 in picture. weird , annoying , couldn't find way fix it.

thanks.

enter image description here

oh wow! tricky!

it doesn't care target platform visual studio set on, looks @ own codeprovider class. using default constructor. has constructor takes dictionary parameter. in parameter specifying version of .net should used. instead of creating new codeprovider object should this:

    dictionary<string, string> compilerinfo = new dictionary<string, string>();     compilerinfo.add("compilerversion", "v3.5");     csharpcodeprovider codeprovider = new csharpcodeprovider(compilerinfo); 

now works.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -