I disagree that it is a difficult task.
static Assembly GenerateSatelliteAssembly() {
CSharpCodeProvider codeProvider = new
Microsoft.CSharp.CSharpCodeProvider();
ICodeCompiler compiler = codeProvider.CreateCompiler();
CompilerParameters Parameters = new CompilerParameters(new string[]
{"mscorlib.dll"});
Parameters.ReferencedAssemblies.Add("System.dll");
Parameters.OutputAssembly = "inmemoryassembly.dll";
Parameters.GenerateExecutable = false;
Parameters.GenerateInMemory = true;
string source = "";
source += "public class OtherObject {";
source += " public static void SomeMethod() {";
source += " System.Console.WriteLine(\"Hello World from other object
located in an in memory assembly\");";
source += " }";
source += "}";
CompilerResults results = compiler.CompileAssemblyFromSource(Parameters,
source);
CheckResults(results);
return results.CompiledAssembly;
}
Cheers,
Greg Young
MVP - C#
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote
in message news:uQ**************@TK2MSFTNGP05.phx.gbl...
Hi,
Dynamic assemblies are code that you generate in your code dynamically.
There are several cases where this is needed.
static assemblies are any other assembly that is stored in a file.
generating an assembly in code is not easy task nor that common at all, I
have never had the need to generate one. and I'm sure the vast majority of
the other posters here wil say the same
why r u so interesting in it?
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Vikas Kumar" <ef*****@newsgroups.nospam> wrote in message
news:OF**************@TK2MSFTNGP05.phx.gbl... this much i was able to found on net on msdn site
i want something with example