Assembly srcAssembly;
int appAssemblyIndex = -1;
- [MonoTODO ("deal with AddAssembliesInBin in the 2.0 case")]
internal TemplateParser ()
{
imports = new ArrayList ();
imports.Add ("System.Web.UI.HtmlControls");
assemblies = new ArrayList ();
-#if CONFIGURATION_2_0
- foreach (AssemblyInfo info in CompilationConfig.Assemblies)
- AddAssemblyByName (info.Assembly);
+#if NET_2_0
+ bool addAssembliesInBin = false;
+ foreach (AssemblyInfo info in CompilationConfig.Assemblies) {
+ if (info.Assembly == "*")
+ addAssembliesInBin = true;
+ else
+ AddAssemblyByName (info.Assembly);
+ }
+ if (addAssembliesInBin)
+ AddAssembliesInBin ();
+
+ foreach (NamespaceInfo info in PagesConfig.Namespaces) {
+ imports.Add (info.Namespace);
+ }
#else
foreach (string a in CompilationConfig.Assemblies)
AddAssemblyByName (a);
}
}
+ internal virtual Assembly AddAssemblyByFileName (string filename)
+ {
+ Assembly assembly = null;
+ Exception error = null;
+
+ try {
+ assembly = Assembly.LoadFrom (filename);
+ } catch (Exception e) { error = e; }
+
+ if (assembly == null)
+ ThrowParseException ("Assembly " + filename + " not found", error);
+
+ AddAssembly (assembly, true);
+ return assembly;
+ }
+
internal virtual Assembly AddAssemblyByName (string name)
{
if (anames == null)
assembly = Assembly.LoadWithPartialName (name);
} catch (Exception e) { error = e; }
}
-
+
if (assembly == null)
ThrowParseException ("Assembly " + name + " not found", error);
// Add the code file as an option to the
// compiler. This lets both files be compiled at once.
- compilerOptions += " " + realPath;
+ compilerOptions += " \"" + realPath + "\"";
} else if (inherits != null) {
// We just set the inherits directly because this is a
// Single-Page model.
get { return oc_param; }
}
-#if CONFIGURATION_2_0
+#if NET_2_0
internal PagesSection PagesConfig {
get {
return WebConfigurationManager.GetSection ("system.web/pages") as PagesSection;