New Message on dotNET User Group Hyd

i want to develop this group a very good group

Reply
  Recommend Message 2 in Discussion
From: Saradhi

Yes,
Its g ood idea.
To begin with, here is my question.
 
I wrote this piece of code:
 
private bool Compile(ArrayList sourceList,ArrayList referencesList)
{
 bool bResult = false;
 Microsoft.VisualBasic.VBCodeProvider provider;
 System.CodeDom.Compiler.ICodeCompiler compiler;
 System.CodeDom.Compiler.CompilerParameters compilerparams; 
 System.CodeDom.Compiler.CompilerResults results;
 
 compilerparams = new System.CodeDom.Compiler.CompilerParameters();
 compilerparams.GenerateInMemory = false;
 compilerparams.TreatWarningsAsErrors = false;
 compilerparams.WarningLevel = 4;
 compilerparams.IncludeDebugInformation = false;
 
 // Prepare the Sources list
 string[] sources = (string[]) sourceList.ToArray(typeof(string));
 //Put any references you need here
 string[] refs = (string[])referencesList.ToArray(typeof(string));
 compilerparams.ReferencedAssemblies.AddRange(refs);
 provider = new Microsoft.VisualBasic.VBCodeProvider();  
 compiler = provider.CreateCompiler();
 results = compiler.CompileAssemblyFromSourceBatch(compilerparams,sources);
 
 // If there are any errros, Fire the Event by sending the CompilerResults Info whcih will be
 // caught in the Code Editor.
 if (results.Errors.Count != 0 )
  {
    bResult = false;
    // Hanlde Errors.
  }
  else
  {
   bResult = true;
   m_Assembly = results.CompiledAssembly;
  }
 
 return bresult;
 
}
 
I am using this function in some of my project and sending the source files and reference list dynamically.
 
For the First time , If I sent 4 files , the Compiler compiles and gives me the Assembly without any problem.
Next Time, if I add another file and send 5 files, it compiles the 5 files very well , but when I tried to access the CompiledAssembly, it is rising the following EXception "File or assembly name xl0oo7b2.dll, or one of its dependencies, was not found."
 
  at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Boolean isStringized, Evidence assemblySecurity, Boolean throwOnFileNotFound, Assembly locationHint, StackCrawlMark& stackMark)
   at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Boolean stringized, Evidence assemblySecurity, StackCrawlMark& stackMark)
   at System.Reflection.Assembly.Load(AssemblyName assemblyRef, Evidence assemblySecurity)
   at System.CodeDom.Compiler.CompilerResults.get_CompiledAssembly()
   at System.CodeDom.Compiler.CompilerResults.get_CompiledAssembly()
 
Any idea?
 
-SARADHI

View other groups in this category.

Click here!
Also on MSN:
Start Chatting | Listen to Music | House & Home | Try Online Dating | Daily Horoscopes

To stop getting this e-mail, or change how often it arrives, go to your E-mail Settings.

Need help? If you've forgotten your password, please go to Passport Member Services.
For other questions or feedback, go to our Contact Us page.

If you do not want to receive future e-mail from this MSN group, or if you received this message by mistake, please click the "Remove" link below. On the pre-addressed e-mail message that opens, simply click "Send". Your e-mail address will be deleted from this group's mailing list.
Remove my e-mail address from dotNET User Group Hyd.

Reply via email to