diff options
author | Gonzalo Paniagua Javier <gonzalo.mono@gmail.com> | 2004-06-08 10:20:11 +0400 |
---|---|---|
committer | Gonzalo Paniagua Javier <gonzalo.mono@gmail.com> | 2004-06-08 10:20:11 +0400 |
commit | 2dbdb5b80ff3258b0e69a5ca8bb171ac59b73ab4 (patch) | |
tree | d66ded51f38e415e8f04f53a55bd5bae3137ed5e /mcs/class/System.Web/System.Web.Compilation/CachingCompiler.cs | |
parent | 25116279622be2cf921608c7bbbb0766e9a3bdb9 (diff) |
2004-06-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* System.Web.dll.sources: removed CSCompiler.cs
* System.Web.Compilation/CSCompiler.cs: removed.
* System.Web.Compilation/CachingCompiler.cs: language independent
compilation for single files.
* System.Web.UI/SimpleWebHandlerParser.cs:
* System.Web.UI/TemplateParser.cs: pass the language when compiling from
a file.
svn path=/trunk/mcs/; revision=29017
Diffstat (limited to 'mcs/class/System.Web/System.Web.Compilation/CachingCompiler.cs')
-rw-r--r-- | mcs/class/System.Web/System.Web.Compilation/CachingCompiler.cs | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/mcs/class/System.Web/System.Web.Compilation/CachingCompiler.cs b/mcs/class/System.Web/System.Web.Compilation/CachingCompiler.cs index 1075ca01f2d..82324ea195f 100644 --- a/mcs/class/System.Web/System.Web.Compilation/CachingCompiler.cs +++ b/mcs/class/System.Web/System.Web.Compilation/CachingCompiler.cs @@ -8,13 +8,12 @@ // (c) Copyright Novell, Inc. (http://www.novell.com) // using System; -using System.CodeDom; using System.CodeDom.Compiler; using System.Collections; using System.Collections.Specialized; -using System.IO; using System.Web.UI; using System.Web.Caching; +using System.Web.Configuration; namespace System.Web.Compilation { @@ -79,7 +78,8 @@ namespace System.Web.Compilation return options; } - public static CompilerResults Compile (string key, string file, ArrayList assemblies) + public static CompilerResults Compile (string language, string key, string file, + ArrayList assemblies) { Cache cache = HttpRuntime.Cache; CompilerResults results = (CompilerResults) cache [key]; @@ -90,9 +90,17 @@ namespace System.Web.Compilation results = (CompilerResults) cache [key]; if (results != null) return results; - + + CompilationConfiguration config; + config = CompilationConfiguration.GetInstance (HttpContext.Current); + CodeDomProvider provider = config.GetProvider (language); + if (provider == null) + throw new HttpException ("Configuration error. Language not supported: " + + language, 500); + + ICodeCompiler compiler = provider.CreateCompiler (); CompilerParameters options = GetOptions (assemblies); - results = CSCompiler.Compiler.CompileAssemblyFromFile (options, file); + results = compiler.CompileAssemblyFromFile (options, file); string [] deps = (string []) assemblies.ToArray (typeof (string)); cache.Insert (key, results, new CacheDependency (deps)); } |