csharpcodeprovider

What are the strengths of Lua over CSharpCodeProvider in C# for dynamic code execution?

In my scenario I want to interpret a script file and execute methods from assemblies. What advantages would Lua offer me? If you have used both Lua and the CSharpCodeProvider please contrast your experience with both. ...

Dynamically loading and unloading a a dll generated using CSharpCodeProvider

I have an app that uses some code scripts to generate dll's at run-time and invoke them as needed and have run into some questions before i go ahead and code it ! Is it possible to unload them from memory when not needed ? If not - what would be the performance impact of loading them into separate appdomains and invoking the calls using...

CSharpCodeProvider seems to be stuck at .NET 2.0, how do I get new features?

I have the following, fairly standard code as a wrapper around CSharpCodeProvider. This class works very well, and performs just fine, etc, etc. But, despite the fact that my application is built against .NET 3.5 and is referencing v3.5 assemblies when doing this compilation, I still don't get access to any of the extra nice C# 3.5 synta...

csc.exe not found error

I have installed a fresh copy of windows xp 2002 with SP2, and then VS.net 2008 enterprise edition. I am trying to build a simplest possible web application, and its not compiling giving error csc.exe not found. I googled a lot, and spot the problem in the following section in web.config : <system.codedom> <compilers> <compiler l...

Exposing C# objects to Lua scripting

Hi, I'm looking into adding scripting to my C# application. I've been debating between Lua and C# (through CSharpCodeProvider). Regardless of which language I use, I need the script to be able to access/manipulate objects/arrays in my main application. With C# I should be able to expose my objects and interface functions without too ...

Assigning a version number to a DLL created using CSharpCodeProvider

I have a method that creates a DLL from a .cs file that is based on the code found here on MSDN. Using that code, is there any way to specify the version number of the DLL that gets generated? Right now it's always 0.0.0.0. I can't find a property or constructor that I can call to specify the version number. ...

CSharpCodeProvider: Why is a result of compilation out of context when debugging

I have following code snippet that i use to compile class at the run time. //now compile the runner var codeProvider = new CSharpCodeProvider( new Dictionary<string, string>() { { "CompilerVersion", "v3.5" } }); string[] references = new string[] { "System.dll", "System.Core.dll", "System.Core.dll" }; CompilerParameters para...

CSharpCodeProvider 'cannot find metadata file' Compiling Plugin Code With Mono

I have some code in an XML file that I load and compile at runtime in an application. This works fine on Windows, but under Mono I get assembly reference errors. Here's the examine code in question: public static bool CompileSpell(Spell spell) { CSharpCodeProvider prov = new CSharpCodeProvider(); CompilerParame...

Extracting property names from a c# source file

I want to parse a c# file. The only thing I want is to determine if it contains a property with a specific name; just a simple true/false response. Or rather, since I'd checking for more than one property in each run, extracting a list of property names could be helpful I thought that I could create an elegant solution using the CodeDom...

CSharpCodeProvider doesn't return compiler warnings when there are no errors

I'm using the CSharpCodeProvider class to compile a C# script which I use as a DSL in my application. When there are warnings but no errors, the Errors property of the resulting CompilerResults instance contains no items. But when I introduce an error, the warnings suddenly get listed in the Errors property as well. string script = @" ...

CSharpCodeProvider - Is it abusable?

Apologies for the shortness of the question, however I don't think it needs much elaboration. Any there any security implications caused by using the CSharpCodeProvider and could it open a server up for attack? ...

CSharpCodeProvider output .NET 2.0 assembly from .NET 4.0 application

I'm using the CSharpCodeProvider to compile a CodeDom object into an assembly. The application itself is running under .NET 4.0. However I need the output from CompileAssemblyFromDom to build against .NET 2.0 for compatibility with some external resources. How can I tell the CSharpCodeProvider to build against .NET 2.0? ...

C# CSharpCodeProvider use custom parameter during compilation

Hi, I use CSharpCodeProvider for compile .net code from C# and generate custom dll. But I want to set custom property in dll like: File Description File Version Product Name It's possible? And I have not found documentation abut the possibility to pass a XML file with all parameters for the compilation... <CSharpScriptCompiler> <Ref...