Assembly GetAssemblyFromSource (string vpath, ILocation location)
{
vpath = UrlUtils.Combine (BaseVirtualDir, vpath);
string realPath = context.Request.MapPath (vpath);
if (!File.Exists (realPath))
throw new ParseException (location, "File " + vpath + " not found");
AddDependency (vpath);
CompilerResults result = CachingCompiler.Compile (language, realPath, realPath, assemblies);
if (result.NativeCompilerReturnValue != 0) {
using (StreamReader sr = new StreamReader (realPath)) {
throw new CompilationException (realPath, result.Errors, sr.ReadToEnd ());
}
}
AddAssembly (result.CompiledAssembly, true);
return result.CompiledAssembly;
}