I'm generating an assembly (*.dll) at runtime. the compilation process is performed using CodeDom, as is recommended in following post:
Generating DLL assembly dynamically at run time
My code and assembly are generated successfully, not errors. The problem comes when I'm attempting load this generated assemblies at runtime via reflection using :
// load for reflection only
var _assemblyTempLoad = Assembly.LoadFrom(assembly.FullName);
Following exception is thrown:
"Could not load file or assembly 'nameforassembly.dll' or one of its dependencies. The module was expected to contain an assembly manifest."
How to generate the manifest file or fix this issue?
I want clarify that assembly is generated at runtime, using following code:
CompilerResults compilerResult = codeDomProvider.CompileAssemblyFromFile(compilerParameters, Path.Combine(path, sourceCodeFile));`
Thank you in advance