Click here to Skip to main content
15,884,986 members
Home / Discussions / C#
   

C#

 
AnswerRe: Status Bar Color? Pin
David Stone8-Oct-02 11:41
sitebuilderDavid Stone8-Oct-02 11:41 
AnswerRe: Status Bar Color? Pin
James T. Johnson8-Oct-02 13:10
James T. Johnson8-Oct-02 13:10 
GeneralRe: Status Bar Color? Pin
Anonymous9-Oct-02 3:05
Anonymous9-Oct-02 3:05 
GeneralRe: Status Bar Color? Pin
Anonymous10-Oct-02 2:40
Anonymous10-Oct-02 2:40 
GeneralCreate Exchange account from existing NT-account Pin
Ola Carlsson8-Oct-02 4:22
Ola Carlsson8-Oct-02 4:22 
Generalputting the exe on a server Pin
shmuelt8-Oct-02 0:33
shmuelt8-Oct-02 0:33 
GeneralRe: putting the exe on a server Pin
James T. Johnson8-Oct-02 7:26
James T. Johnson8-Oct-02 7:26 
QuestionRun time compilation with ASSEMBLIES?!? Pin
EdgarBM7-Oct-02 23:16
EdgarBM7-Oct-02 23:16 
Hi,
I'm compiling in run time with a code like this:

   CSharpCodeProvider codeProvider = new CSharpCodeProvider();<br />
   ICodeCompiler icc = codeProvider.CreateCompiler();<br />
<br />
   System.CodeDom.Compiler.CompilerParameters parameters = new<br />
CompilerParameters();<br />
   parameters.GenerateExecutable = false;<br />
   parameters.GenerateInMemory = true;<br />
   CompilerResults results = icc.CompileAssemblyFromSource(parameters,<br />
txtSource );<br />
<br />
   if (results.Errors.Count > 0)<br />
   {<br />
    foreach(CompilerError CompErr in results.Errors)<br />
    {<br />
     txtErr.Text += "Line number " + CompErr.Line +<br />
      ", Error Number: " + CompErr.ErrorNumber +<br />
      ", '" + CompErr.ErrorText + ";" +<br />
      Environment.NewLine + Environment.NewLine;<br />
    }<br />
   }<br />
   else<br />
   {<br />
<br />
    Assembly   assembly = results.CompiledAssembly;<br />
    Type   t = assembly.GetType("MyNamespace.MyClass");<br />
<br />
    MethodInfo me = t.GetMethod("MyMethod");<br />
<br />
    object result;<br />
    result = t.InvokeMember("MyMethod2", BindingFlags.Public |<br />
BindingFlags.Static | BindingFlags.InvokeMethod ,<br />
      null, null, null );<br />
    MessageBox.Show ( ((int)result).ToString() ); // get the result as<br />
string<br />
<br />
   }<br />
  } //(provided by Wiktor Zychla)


The problem is: how can I specify reference assemblies to the run time compiled assembly?, is it possible?

'ReferencedAssemblies' in 'CompilerParameters' is only of read mode, so it's not possible to set them...I'm wrong?

Thanks in advance,
Edgar


__________________________________________
Edgar Berengena Moreno
Software Engineer
Appeyron Research

AnswerRe: Run time compilation with ASSEMBLIES?!? Pin
Stephane Rodriguez.7-Oct-02 23:34
Stephane Rodriguez.7-Oct-02 23:34 
GeneralRe: Run time compilation with ASSEMBLIES?!? ** GREAT! ** Pin
EdgarBM7-Oct-02 23:41
EdgarBM7-Oct-02 23:41 
GeneralAn interesting question I think Pin
TheFLC7-Oct-02 23:15
TheFLC7-Oct-02 23:15 
GeneralRe: An interesting question I think Pin
Stephane Rodriguez.7-Oct-02 23:25
Stephane Rodriguez.7-Oct-02 23:25 
GeneralRe: An interesting question I think Pin
TheFLC7-Oct-02 23:50
TheFLC7-Oct-02 23:50 
GeneralRe: An interesting question I think Pin
leppie8-Oct-02 2:44
leppie8-Oct-02 2:44 
GeneralRe: An interesting question I think Pin
TheFLC8-Oct-02 2:10
TheFLC8-Oct-02 2:10 
QuestionA memory eater app... what could be wrong?? Pin
Anonymous7-Oct-02 14:11
Anonymous7-Oct-02 14:11 
AnswerRe: A memory eater app... what could be wrong?? Pin
David Stone7-Oct-02 17:36
sitebuilderDavid Stone7-Oct-02 17:36 
AnswerRe: A memory eater app... what could be wrong?? Pin
Daniel Turini8-Oct-02 1:48
Daniel Turini8-Oct-02 1:48 
GeneralC# under SuSe Linux Pin
gremlin7-Oct-02 13:13
gremlin7-Oct-02 13:13 
GeneralRe: C# under SuSe Linux Pin
Gerald Schwab7-Oct-02 13:17
Gerald Schwab7-Oct-02 13:17 
GeneralPlaying raw audio samples Pin
David Williams7-Oct-02 12:45
David Williams7-Oct-02 12:45 
GeneralRe: Playing raw audio samples Pin
leppie7-Oct-02 14:50
leppie7-Oct-02 14:50 
GeneralIE History Pin
Tomas Petricek7-Oct-02 12:31
Tomas Petricek7-Oct-02 12:31 
GeneralRe: IE History Pin
Stephane Rodriguez.7-Oct-02 23:23
Stephane Rodriguez.7-Oct-02 23:23 
GeneralRe: IE History Pin
Tomas Petricek8-Oct-02 1:33
Tomas Petricek8-Oct-02 1:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.