Преглед на файлове

2006-02-10 Gonzalo Paniagua Javier <[email protected]>

	* System.Web.Configuration_2.0/Compiler.cs:
	* System.Web.Configuration_2.0/CompilerCollection.cs: removed
	compatibility code.

	* System.Web.Configuration_2.0/BuildProviderCollection.cs: add
	GetProviderForExtension().

	* System.Web.UI/IThemeResolutionService.cs: this is now added to the
	sources file, but some other stuff does not compile yet as the
	interface changed after the beta.

	* System.Web.UI/ObjectConverter.cs: removed extra attribute.

	* System.Web.UI/ObjectStateFormatter.cs: add IStateFormatter for 2.0.

	* System.Web.UI/ICallbackEventHandler.cs: update the interface, but
	commented the 'good' stuff out, since other files need to be fixed
	too.

	* System.Web.dll.sources: add new files.

	* System.Web.Configuration/CompilationConfiguration.cs:
	* System.Web.Configuration/CompilationConfigurationHandler.cs: only
	compile these for pre-2.0 assemblies.

	* System.Web.Hosting/DefaultVirtualPathProvider.cs: add some
	comments/TODO.
	* System.Web.Hosting/HostingEnvironment.cs: initialize the
	default value for VirtualPathProvider.

	* System.Web.Compilation/CompilerType.cs: implemented.

	* System.Web.Compilation/AssemblyBuilder.cs: implemented most of it.

	* System.Web.Compilation/WebServiceCompiler.cs:
	* System.Web.Compilation/CachingCompiler.cs: update 2.0 compiler
	instance creation code.

	* System.Web.Compilation/ClientBuildManager.cs: implemented some of
	its methods. Not yet ready.

	* System.Web.Compilation/BuildManager.cs: the more interesting methods
	are implemented now.

	* System.Web.Compilation/BaseCompiler.cs: delete the temporary files
	in case of error.

	* System.Web.Compilation/BuildProvider.cs: implemented the
	Get*Compiler* protected methods.


svn path=/trunk/mcs/; revision=56781
Gonzalo Paniagua Javier преди 20 години
родител
ревизия
6be4ffb621
променени са 26 файла, в които са добавени 436 реда и са изтрити 113 реда
  1. 4 0
      mcs/class/System.Web/ChangeLog
  2. 93 18
      mcs/class/System.Web/System.Web.Compilation/AssemblyBuilder.cs
  3. 6 3
      mcs/class/System.Web/System.Web.Compilation/BaseCompiler.cs
  4. 100 8
      mcs/class/System.Web/System.Web.Compilation/BuildManager.cs
  5. 68 6
      mcs/class/System.Web/System.Web.Compilation/BuildProvider.cs
  6. 2 1
      mcs/class/System.Web/System.Web.Compilation/CachingCompiler.cs
  7. 18 0
      mcs/class/System.Web/System.Web.Compilation/ChangeLog
  8. 52 13
      mcs/class/System.Web/System.Web.Compilation/ClientBuildManager.cs
  9. 15 16
      mcs/class/System.Web/System.Web.Compilation/CompilerType.cs
  10. 2 1
      mcs/class/System.Web/System.Web.Compilation/WebServiceCompiler.cs
  11. 6 0
      mcs/class/System.Web/System.Web.Configuration/ChangeLog
  12. 2 0
      mcs/class/System.Web/System.Web.Configuration/CompilationConfiguration.cs
  13. 2 1
      mcs/class/System.Web/System.Web.Configuration/CompilationConfigurationHandler.cs
  14. 9 2
      mcs/class/System.Web/System.Web.Configuration_2.0/BuildProviderCollection.cs
  15. 7 0
      mcs/class/System.Web/System.Web.Configuration_2.0/ChangeLog
  16. 0 17
      mcs/class/System.Web/System.Web.Configuration_2.0/Compiler.cs
  17. 0 13
      mcs/class/System.Web/System.Web.Configuration_2.0/CompilerCollection.cs
  18. 6 0
      mcs/class/System.Web/System.Web.Hosting/ChangeLog
  19. 13 2
      mcs/class/System.Web/System.Web.Hosting/DefaultVirtualPathProvider.cs
  20. 2 1
      mcs/class/System.Web/System.Web.Hosting/HostingEnvironment.cs
  21. 13 0
      mcs/class/System.Web/System.Web.UI/ChangeLog
  22. 2 0
      mcs/class/System.Web/System.Web.UI/ICallbackEventHandler.cs
  23. 3 2
      mcs/class/System.Web/System.Web.UI/IThemeResolutionService.cs
  24. 0 3
      mcs/class/System.Web/System.Web.UI/ObjectConverter.cs
  25. 10 6
      mcs/class/System.Web/System.Web.UI/ObjectStateFormatter.cs
  26. 1 0
      mcs/class/System.Web/System.Web.dll.sources

+ 4 - 0
mcs/class/System.Web/ChangeLog

@@ -1,3 +1,7 @@
+2006-02-10 Gonzalo Paniagua Javier <[email protected]>
+
+	* System.Web.dll.sources: add new files.
+
 2006-01-22  Chris Toshok  <[email protected]>
 
 	* System.Web.dll.sources: add IgnoreFileBuildProvider.cs and

+ 93 - 18
mcs/class/System.Web/System.Web.Compilation/AssemblyBuilder.cs

@@ -3,6 +3,7 @@
 //
 // Authors:
 //	Chris Toshok ([email protected])
+//	Gonzalo Paniagua Javier ([email protected])
 //
 // (C) 2006 Novell, Inc (http://www.novell.com)
 //
@@ -33,62 +34,136 @@
 using System;
 using System.CodeDom;
 using System.CodeDom.Compiler;
+using System.Collections.Generic;
+using System.Collections.Specialized;
 using System.IO;
 using System.Reflection;
+using System.Web.Configuration;
+using System.Web.Util;
 
 namespace System.Web.Compilation {
 
 	public class AssemblyBuilder {
+		static bool KeepFiles = (Environment.GetEnvironmentVariable ("MONO_ASPNET_NODELETE") != null);
+
+		CodeDomProvider provider;
+		List <CodeCompileUnit> units;
+		List <string> source_files;
+		Dictionary <string, string> resource_files;
+		TempFileCollection temp_files;
+		string virtual_path;
+		
+		internal AssemblyBuilder (string virtualPath, CodeDomProvider provider)
+		{
+			this.provider = provider;
+			this.virtual_path = virtualPath;
+			units = new List <CodeCompileUnit> ();
+			units.Add (new CodeCompileUnit ());
+			temp_files = new TempFileCollection ();
+			CompilationSection section;
+			section = (CompilationSection) WebConfigurationManager.GetSection ("system.web/compilation", virtualPath);
+			string tempdir = section.TempDirectory;
+			if (tempdir == null || tempdir == "")
+				tempdir = AppDomain.CurrentDomain.SetupInformation.DynamicBase;
+				
+			temp_files = new TempFileCollection (tempdir, KeepFiles);
+		}
+
+		internal TempFileCollection TempFiles {
+			get { return temp_files; }
+		}
 
-		internal AssemblyBuilder ()
+		internal CodeCompileUnit [] GetUnitsAsArray ()
 		{
+			CodeCompileUnit [] result = new CodeCompileUnit [units.Count];
+			units.CopyTo (result, 0);
+			return result;
+		}
+
+		List <string> SourceFiles {
+			get {
+				if (source_files == null)
+					source_files = new List <string> ();
+				return source_files;
+			}
+		}
+
+		Dictionary <string, string> ResourceFiles {
+			get {
+				if (resource_files == null)
+					resource_files = new Dictionary <string, string> ();
+				return resource_files;
+			}
 		}
 
-		[MonoTODO]
 		public void AddAssemblyReference (Assembly a)
 		{
-			throw new NotImplementedException ();
+			if (a == null)
+				throw new ArgumentNullException ("a");
+
+			StringCollection coll = units [units.Count - 1].ReferencedAssemblies;
+			string location = a.Location;
+			if (coll.IndexOf (location) == -1)
+				coll.Add (location);
 		}
 
-		[MonoTODO]
+		[MonoTODO ("Do something with the buildProvider argument")]
 		public void AddCodeCompileUnit (BuildProvider buildProvider, CodeCompileUnit compileUnit)
 		{
-			throw new NotImplementedException ();
+			if (buildProvider == null)
+				throw new ArgumentNullException ("buildProvider");
+
+			if (compileUnit == null)
+				throw new ArgumentNullException ("compileUnit");
+
+			units.Add (compileUnit);
 		}
 
-		[MonoTODO]
+		[MonoTODO ("Anything to do with the buildProvider argument?")]
 		public TextWriter CreateCodeFile (BuildProvider buildProvider)
 		{
-			throw new NotImplementedException ();
+			if (buildProvider == null)
+				throw new ArgumentNullException ("buildProvider");
+
+			string filename = temp_files.AddExtension ("temp", true);
+			SourceFiles.Add (filename);
+			return new StreamWriter (File.OpenWrite (filename), WebEncoding.FileEncoding);
 		}
 
-		[MonoTODO]
+		[MonoTODO ("Anything to do with the buildProvider argument?")]
 		public Stream CreateEmbeddedResource (BuildProvider buildProvider, string name)
 		{
-			throw new NotImplementedException ();
+			if (buildProvider == null)
+				throw new ArgumentNullException ("buildProvider");
+
+			if (name == null || name == "")
+				throw new ArgumentNullException ("name");
+
+			string filename = temp_files.AddExtension ("resource", true);
+			Stream stream = File.OpenWrite (filename);
+			ResourceFiles [name] = filename;
+			return stream;
 		}
 
 		[MonoTODO]
 		public void GenerateTypeFactory (string typeName)
 		{
-			throw new NotImplementedException ();
+			// Do nothing by now.
 		}
 
-		[MonoTODO]
 		public string GetTempFilePhysicalPath (string extension)
 		{
-			throw new NotImplementedException ();
+			if (extension == null)
+				throw new ArgumentNullException ("extension");
+
+			return temp_files.AddExtension (extension, true);
 		}
 
-		[MonoTODO]
 		public CodeDomProvider CodeDomProvider {
-			get {
-				throw new NotImplementedException ();
-			}
+			get { return provider; }
 		}
 
 	}
-
 }
-
 #endif
+

+ 6 - 3
mcs/class/System.Web/System.Web.Compilation/BaseCompiler.cs

@@ -315,7 +315,7 @@ namespace System.Web.Compilation
 		{
 			return AppDomain.CurrentDomain.SetupInformation.DynamicBase;
 		}
-		
+
 		public virtual Type GetCompiledType () 
 		{
 			Type type = CachingCompiler.GetTypeFromCache (parser.InputFile);
@@ -327,7 +327,8 @@ namespace System.Web.Compilation
 #if NET_2_0
 			CompilationSection config = (CompilationSection) WebConfigurationManager.GetSection ("system.web/compilation");
 			Compiler comp = config.Compilers[lang];
-			provider = comp.Provider;
+			Type t = Type.GetType (comp.Type, true);
+			provider = Activator.CreateInstance (t) as CodeDomProvider;
 
 			string compilerOptions = comp.CompilerOptions;
 			int warningLevel = comp.WarningLevel;
@@ -366,9 +367,11 @@ namespace System.Web.Compilation
 			CheckCompilerErrors (results);
 			Assembly assembly = results.CompiledAssembly;
 			if (assembly == null) {
-				if (!File.Exists (compilerParameters.OutputAssembly))
+				if (!File.Exists (compilerParameters.OutputAssembly)) {
+					results.TempFiles.Delete ();
 					throw new CompilationException (parser.InputFile, results.Errors,
 						"No assembly returned after compilation!?");
+				}
 
 				assembly = Assembly.LoadFrom (compilerParameters.OutputAssembly);
 			}

+ 100 - 8
mcs/class/System.Web/System.Web.Compilation/BuildManager.cs

@@ -3,6 +3,7 @@
 //
 // Authors:
 //	Chris Toshok ([email protected])
+//	Gonzalo Paniagua Javier ([email protected])
 //
 // (C) 2006 Novell, Inc (http://www.novell.com)
 //
@@ -31,33 +32,102 @@
 #if NET_2_0
 
 using System;
+using System.CodeDom;
+using System.CodeDom.Compiler;
 using System.Collections;
+using System.IO;
 using System.Reflection;
 using System.Web;
+using System.Web.Configuration;
+using System.Web.Hosting;
 
 namespace System.Web.Compilation {
 	public sealed class BuildManager {
-
 		internal BuildManager ()
 		{
 		}
 
-		[MonoTODO]
+		internal static void ThrowNoProviderException (string extension)
+		{
+			string msg = "No registered provider for extension '{0}'.";
+			throw new HttpException (String.Format (msg, extension));
+		}
+
 		public static object CreateInstanceFromVirtualPath (string virtualPath, Type requiredBaseType)
 		{
-			throw new NotImplementedException ();
+			// virtualPath + Exists done in GetCompiledType()
+			if (requiredBaseType == null)
+				throw new NullReferenceException (); // This is what MS does, but from somewhere else.
+
+			// Get the Type.
+			Type type = GetCompiledType (virtualPath);
+			if (!requiredBaseType.IsAssignableFrom (type)) {
+				string msg = String.Format ("Type '{0}' does not inherit from '{1}'.",
+								type.FullName, requiredBaseType.FullName);
+				throw new HttpException (500, msg);
+			}
+
+			return Activator.CreateInstance (type, null);
 		}
 
 		[MonoTODO]
 		public static BuildDependencySet GetCachedBuildDependencySet (HttpContext context, string virtualPath)
 		{
-			throw new NotImplementedException ();
+			return null; // null is ok here until we store the dependency set in the Cache.
 		}
 
-		[MonoTODO]
 		public static Assembly GetCompiledAssembly (string virtualPath)
 		{
-			throw new NotImplementedException ();
+			if (virtualPath == null || virtualPath == "")
+				throw new ArgumentNullException ("virtualPath");
+
+			if (virtualPath [0] != '/')
+				throw new ArgumentException ("The virtual path is not rooted", "virtualPath");
+
+			if (!HostingEnvironment.VirtualPathProvider.FileExists (virtualPath))
+				throw new HttpException (String.Format ("The file '{0}' does not exist.", virtualPath));
+
+			object o = WebConfigurationManager.GetSection ("system.web/compilation/buildProviders", virtualPath);
+			BuildProviderCollection coll = (BuildProviderCollection) o;
+			string extension = VirtualPathUtility.GetExtension (virtualPath);
+			if (coll == null || coll.Count == 0)
+				ThrowNoProviderException (extension);
+
+			BuildProvider build_provider = coll.GetProviderForExtension (extension);
+			if (build_provider == null)
+				ThrowNoProviderException (extension);
+
+			CompilerType compiler_type = build_provider.CodeCompilerType;
+			Type ctype = compiler_type.CodeDomProviderType;
+			CodeDomProvider dom_provider = (CodeDomProvider) Activator.CreateInstance (ctype, null);
+
+			AssemblyBuilder abuilder = new AssemblyBuilder (virtualPath, dom_provider);
+			build_provider.SetVirtualPath (virtualPath);
+			build_provider.GenerateCode (abuilder);
+
+			CompilerResults results;
+			CompilerParameters parameters;
+			parameters = PrepareParameters (abuilder.TempFiles, virtualPath, compiler_type.CompilerParameters);
+
+			CodeCompileUnit [] units = abuilder.GetUnitsAsArray ();
+			results = dom_provider.CompileAssemblyFromDom (parameters, units);
+			// FIXME: generate the code and display it
+			if (results.NativeCompilerReturnValue != 0)
+				throw new CompilationException (virtualPath, results.Errors, "");
+
+			Assembly assembly = results.CompiledAssembly;
+			if (assembly == null) {
+				if (!File.Exists (parameters.OutputAssembly)) {
+					results.TempFiles.Delete ();
+					throw new CompilationException (virtualPath, results.Errors,
+						"No assembly returned after compilation!?");
+				}
+
+				assembly = Assembly.LoadFrom (parameters.OutputAssembly);
+			}
+
+			results.TempFiles.Delete ();
+			return assembly;
 		}
 
 		[MonoTODO]
@@ -66,12 +136,32 @@ namespace System.Web.Compilation {
 			throw new NotImplementedException ();
 		}
 
-		[MonoTODO]
+		static CompilerParameters PrepareParameters (TempFileCollection temp_files,
+								string virtualPath,
+								CompilerParameters base_params)
+		{
+			CompilerParameters res = new CompilerParameters ();
+			res.TempFiles = temp_files;
+			res.CompilerOptions = base_params.CompilerOptions;
+			res.IncludeDebugInformation = base_params.IncludeDebugInformation;
+			res.TreatWarningsAsErrors = base_params.TreatWarningsAsErrors;
+			res.WarningLevel = base_params.WarningLevel;
+			string dllfilename = Path.GetFileName (temp_files.AddExtension ("dll", true));
+			res.OutputAssembly = Path.Combine (temp_files.TempDir, dllfilename);
+			return res;
+		}
+
 		public static Type GetCompiledType (string virtualPath)
 		{
-			throw new NotImplementedException ();
+			Assembly assembly = GetCompiledAssembly (virtualPath);
+			Type [] types = assembly.GetTypes ();
+			if (types.Length != 1)
+				throw new CompilationException (virtualPath, null, "");
+
+			return types [0];
 		}
 
+		// The 3 GetType() overloads work on the global.asax, App_GlobalResources, App_WebReferences or App_Browsers
 		[MonoTODO]
 		public static Type GetType (string typeName, bool throwOnError)
 		{
@@ -90,6 +180,7 @@ namespace System.Web.Compilation {
 			throw new NotImplementedException ();
 		}
 
+		// Assemblies built from the App_Code directory
 		[MonoTODO]
 		public static IList CodeAssemblies {
 			get {
@@ -101,3 +192,4 @@ namespace System.Web.Compilation {
 }
 
 #endif
+

+ 68 - 6
mcs/class/System.Web/System.Web.Compilation/BuildProvider.cs

@@ -34,6 +34,7 @@
 using System;
 using System.CodeDom.Compiler;
 using System.Collections;
+using System.Collections.Specialized;
 using System.IO;
 using System.Reflection;
 using System.Web.Configuration;
@@ -43,15 +44,21 @@ using System.Web.Util;
 namespace System.Web.Compilation {
 
 	public abstract class BuildProvider {
-		CompilerParameters parameters;
-		CompilerType code_compiler_type;
+		static object locker = new object ();
+		static string private_bin_path;
+
 		string virtual_path;
 		ArrayList ref_assemblies;
+
 		ICollection vpath_deps;
 
 		protected BuildProvider()
 		{
-			parameters = new CompilerParameters ();
+		}
+
+		internal void SetVirtualPath (string path)
+		{
+			virtual_path = path;
 		}
 
 		public virtual void GenerateCode (AssemblyBuilder assemblyBuilder)
@@ -68,7 +75,45 @@ namespace System.Web.Compilation {
 		{
 			CompilationSection config;
 			config = (CompilationSection) WebConfigurationManager.GetSection ("system.web/compilation");
-			return config.BuildProviders.GetProviderForLanguage (config.DefaultLanguage);
+			return GetDefaultCompilerTypeForLanguage (config.DefaultLanguage);
+		}
+
+		void SetCommonParameters (CompilationSection config, CompilerParameters p)
+		{
+			p.IncludeDebugInformation = config.Debug;
+			foreach (AssemblyInfo info in config.Assemblies) {
+				if (info.Assembly != "*") {
+					p.ReferencedAssemblies.Add (info.Assembly);
+				} else {
+					AddAssembliesInBin (p.ReferencedAssemblies);
+				}
+			}
+
+			// explicit, strict?
+			// embedded? linked?/resources
+		}
+
+		
+		static void InitPath ()
+		{
+			lock (locker) {
+				if (private_bin_path != null)
+					return;
+
+				AppDomainSetup setup = AppDomain.CurrentDomain.SetupInformation;
+				private_bin_path = Path.Combine (setup.ApplicationBase, setup.PrivateBinPath);
+			}
+		}
+
+		void AddAssembliesInBin (StringCollection coll)
+		{
+			InitPath ();
+			if (!Directory.Exists (private_bin_path))
+				return;
+
+			string [] binDlls = Directory.GetFiles (private_bin_path, "*.dll");
+			foreach (string s in binDlls)
+				coll.Add (s);
 		}
 
 		protected CompilerType GetDefaultCompilerTypeForLanguage (string language)
@@ -79,7 +124,24 @@ namespace System.Web.Compilation {
 
 			CompilationSection config;
 			config = (CompilationSection) WebConfigurationManager.GetSection ("system.web/compilation");
-			return config.BuildProviders.GetProviderForLanguage (language);
+			Compiler compiler = config.Compilers.Get (language);
+			CompilerParameters p;
+			if (compiler != null) {
+				Type type = Type.GetType (compiler.Type, true);
+				p = new CompilerParameters ();
+				p.CompilerOptions = compiler.CompilerOptions;
+				p.WarningLevel = compiler.WarningLevel;
+				SetCommonParameters (config, p);
+				return new CompilerType (type, p);
+			}
+
+			if (!CodeDomProvider.IsDefinedLanguage (language))
+				throw new HttpException (String.Format ("No compiler for language '{0}'.", language));
+
+			CompilerInfo info = CodeDomProvider.GetCompilerInfo (language);
+			CompilerParameters par = info.CreateDefaultCompilerParameters ();
+			SetCommonParameters (config, par);
+			return new CompilerType (info.CodeDomProviderType, par);
 		}
 
 		public virtual Type GetGeneratedType (CompilerResults results)
@@ -115,7 +177,7 @@ namespace System.Web.Compilation {
 		}
 
 		public virtual CompilerType CodeCompilerType {
-			get { return code_compiler_type; }
+			get { return null; } // Documented to return null
 		}
 
 		protected ICollection ReferencedAssemblies {

+ 2 - 1
mcs/class/System.Web/System.Web.Compilation/CachingCompiler.cs

@@ -149,7 +149,8 @@ namespace System.Web.Compilation
 #if NET_2_0
 				CompilationSection config = (CompilationSection) WebConfigurationManager.GetSection ("system.web/compilation");
 				Compiler c = config.Compilers[language];
-				CodeDomProvider provider = c.Provider;
+				Type t = Type.GetType (c.Type, true);
+				CodeDomProvider provider = Activator.CreateInstance (t) as CodeDomProvider;
 #else
 				CompilationConfiguration config;
 				config = CompilationConfiguration.GetInstance (HttpContext.Current);

+ 18 - 0
mcs/class/System.Web/System.Web.Compilation/ChangeLog

@@ -1,3 +1,21 @@
+2006-02-10 Gonzalo Paniagua Javier <[email protected]>
+
+	* CompilerType.cs: implemented.
+
+	* AssemblyBuilder.cs: implemented most of it.
+
+	* WebServiceCompiler.cs:
+	* CachingCompiler.cs: update 2.0 compiler instance creation code.
+
+	* ClientBuildManager.cs: implemented some of its methods. Not yet
+	ready.
+
+	* BuildManager.cs: the more interesting methods are implemented now.
+
+	* BaseCompiler.cs: delete the temporary files in case of error.
+
+	* BuildProvider.cs: implemented the Get*Compiler* protected methods.
+
 2006-02-07  Chris Toshok  <[email protected]>
 
 	* TemplateControlCompiler.cs (AddParsedSubObjectStmt): append the

+ 52 - 13
mcs/class/System.Web/System.Web.Compilation/ClientBuildManager.cs

@@ -3,6 +3,7 @@
 //
 // Authors:
 //	Chris Toshok ([email protected])
+//	Gonzalo Paniagua Javier ([email protected])
 //
 // (C) 2006 Novell, Inc (http://www.novell.com)
 //
@@ -34,29 +35,68 @@ using System;
 using System.CodeDom;
 using System.CodeDom.Compiler;
 using System.Collections;
+using System.IO;
 using System.Web;
 using System.Web.Hosting;
 
 namespace System.Web.Compilation {
+	public sealed class ClientBuildManager : MarshalByRefObject, IDisposable {
+		string virt_dir;
+		string phys_src_dir;
+		string phys_target_dir;
+		ClientBuildManagerParameter build_params;
 
-	public sealed class ClientBuildManager : MarshalByRefObject, IDisposable
-	{
-		[MonoTODO]
 		public ClientBuildManager (string appVirtualDir, string appPhysicalSourceDir)
 		{
-			throw new NotImplementedException ();
+			virt_dir = appVirtualDir; // TODO: adjust vpath (it allows 'blah' that turns into '/blah', '////blah', '\\blah'...
+			phys_src_dir = appPhysicalSourceDir;
 		}
 
-		[MonoTODO]
-		public ClientBuildManager (string appVirtualDir, string appPhysicalSourceDir, string appPhysicalTargetDir)
+		public ClientBuildManager (string appVirtualDir, string appPhysicalSourceDir,
+					string appPhysicalTargetDir)
+			: this (appVirtualDir, appPhysicalSourceDir)
 		{
-			throw new NotImplementedException ();
+			phys_target_dir = appPhysicalTargetDir;
 		}
 
-		[MonoTODO]
-		public ClientBuildManager (string appVirtualDir, string appPhysicalSourceDir, string appPhysicalTargetDir, ClientBuildManagerParameter parameter)
+		public ClientBuildManager (string appVirtualDir, string appPhysicalSourceDir,
+					string appPhysicalTargetDir, ClientBuildManagerParameter parameter)
+			: this (appVirtualDir, appPhysicalSourceDir, appPhysicalTargetDir)
 		{
-			throw new NotImplementedException ();
+			build_params = parameter;
+		}
+
+		string CreateCodeGenDir ()
+		{
+			return null;
+		/*
+			string appname = null;
+			if (virt_dir == "/") {
+				appname = "root";
+			} else {
+				appname = virt_dir.Subtring (1).Replace ('/', '_');
+			}
+
+			string dynamic_dir = null;
+			string user = Environment.UserName;
+			for (int i = 0; ; i++){
+				string d = Path.Combine (Path.GetTempPath (),
+					String.Format ("{0}-temp-aspnet-{1:x}", user, i));
+			
+				try {
+					Directory.CreateDirectory (d);
+					string stamp = Path.Combine (d, "stamp");
+					Directory.CreateDirectory (stamp);
+					dynamic_dir = d;
+					Directory.Delete (stamp);
+					break;
+				} catch (UnauthorizedAccessException){
+					continue;
+				}
+			}
+			setup.DynamicBase = dynamic_dir;
+			Directory.CreateDirectory (setup.DynamicBase);
+			*/
 		}
 
 		[MonoTODO]
@@ -65,10 +105,9 @@ namespace System.Web.Compilation {
 			throw new NotImplementedException ();
 		}
 
-		[MonoTODO]
 		public void CompileFile (string virtualPath)
 		{
-			throw new NotImplementedException ();
+			CompileFile (virtualPath, null);
 		}
 
 		[MonoTODO]
@@ -102,7 +141,7 @@ namespace System.Web.Compilation {
 		}
 
 		[MonoTODO]
-		public string[ ] GetAppDomainShutdownDirectories ()
+		public string [] GetAppDomainShutdownDirectories ()
 		{
 			throw new NotImplementedException ();
 		}

+ 15 - 16
mcs/class/System.Web/System.Web.Compilation/CompilerType.cs

@@ -3,6 +3,7 @@
 //
 // Authors:
 //	Chris Toshok ([email protected])
+//	Gonzalo Paniagua Javier ([email protected])
 //
 // (C) 2006 Novell, Inc (http://www.novell.com)
 //
@@ -36,40 +37,38 @@ using System.CodeDom.Compiler;
 namespace System.Web.Compilation {
 
 	public sealed class CompilerType {
+		Type type;
+		CompilerParameters parameters;
 
-		internal CompilerType ()
+		internal CompilerType (Type type, CompilerParameters parameters)
 		{
+			this.type = type;
+			this.parameters = parameters;
 		}
 
-		[MonoTODO]
 		public override bool Equals(object o)
 		{
-			throw new NotImplementedException ();
+			if (!(o is CompilerType))
+				return false;
+
+			CompilerType other = (CompilerType) o;
+			//FIXME: parameters does NOT have an Equals override
+			return (other.type == type && other.parameters == parameters);
 		}
 
-		[MonoTODO]
 		public override int GetHashCode()
 		{
-			throw new NotImplementedException ();
+			return ((type.GetHashCode () << 6) ^ parameters.GetHashCode ());
 		}
 
-		[MonoTODO]
 		public Type CodeDomProviderType {
-			get {
-				throw new NotImplementedException ();
-			}
+			get { return type; }
 		}
 
-		[MonoTODO]
 		public CompilerParameters CompilerParameters {
-			get {
-				throw new NotImplementedException ();
-			}
+			get { return parameters; }
 		}
-
 	}
 }
-
 #endif
 
-

+ 2 - 1
mcs/class/System.Web/System.Web.Compilation/WebServiceCompiler.cs

@@ -73,7 +73,8 @@ namespace System.Web.Compilation
 #if NET_2_0
 			CompilationSection config = (CompilationSection)WebConfigurationManager.GetSection ("system.web/compilation");
 			Compiler c = config.Compilers[lang];
-			provider = (c == null) ? null : c.Provider;
+			Type t = Type.GetType (c.Type, true);
+			provider = Activator.CreateInstance (t) as CodeDomProvider;
 #else
 			CompilationConfiguration config;
 			config = CompilationConfiguration.GetInstance (parser.Context);

+ 6 - 0
mcs/class/System.Web/System.Web.Configuration/ChangeLog

@@ -1,3 +1,9 @@
+2006-02-10 Gonzalo Paniagua Javier <[email protected]>
+
+	* CompilationConfiguration.cs:
+	* CompilationConfigurationHandler.cs: only compile these for
+	pre-2.0 assemblies.
+
 2006-02-01  Chris Toshok  <[email protected]>
 
 	* CompilerCollection.cs: CONFIGURATION_2_0 => NET_2_0.

+ 2 - 0
mcs/class/System.Web/System.Web.Configuration/CompilationConfiguration.cs

@@ -28,6 +28,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
+#if !NET_2_0
 using System;
 using System.CodeDom.Compiler;
 using System.Collections;
@@ -214,3 +215,4 @@ namespace System.Web.Configuration
 		}
 	}
 }
+#endif

+ 2 - 1
mcs/class/System.Web/System.Web.Configuration/CompilationConfigurationHandler.cs

@@ -27,7 +27,7 @@
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-
+#if !NET_2_0
 using System;
 using System.Collections;
 using System.Configuration;
@@ -198,4 +198,5 @@ namespace System.Web.Configuration
 		}
 	}
 }
+#endif
 

+ 9 - 2
mcs/class/System.Web/System.Web.Configuration_2.0/BuildProviderCollection.cs

@@ -93,9 +93,16 @@ namespace System.Web.Configuration
 			return prov.Extension;
 		}
 
-		[MonoTODO ("Implement me")]
-		internal System.Web.Compilation.CompilerType GetProviderForLanguage (string language)
+		internal System.Web.Compilation.BuildProvider GetProviderForExtension (string extension)
 		{
+			foreach (BuildProvider provider in this) {
+				if (extension != provider.Extension)
+					continue;
+
+				Type type = Type.GetType (provider.Type);
+				return (System.Web.Compilation.BuildProvider) Activator.CreateInstance (type, null);
+			}
+
 			return null;
 		}
 	}

+ 7 - 0
mcs/class/System.Web/System.Web.Configuration_2.0/ChangeLog

@@ -1,3 +1,10 @@
+2006-02-10 Gonzalo Paniagua Javier <[email protected]>
+
+	* Compiler.cs:
+	* CompilerCollection.cs: removed compatibility code.
+
+	* BuildProviderCollection.cs: add GetProviderForExtension().
+
 2006-02-02  Chris Toshok  <[email protected]>
 
 	* WebConfigurationManager.cs (GetSection(string,string)):

+ 0 - 17
mcs/class/System.Web/System.Web.Configuration_2.0/Compiler.cs

@@ -112,23 +112,6 @@ namespace System.Web.Configuration
 		protected override ConfigurationPropertyCollection Properties {
 			get { return properties; }
 		}
-
-#region CompatabilityCode
-		[MonoTODO ("we shouldn't need this")]
-		CodeDomProvider provider;
-		internal CodeDomProvider Provider {
-			get { 
-				if (provider == null) {
-					Type t = System.Type.GetType (this.Type);
-					provider = Activator.CreateInstance (t) as CodeDomProvider;
-				}
-				return provider;
-			}
-			set {
-				provider = value;
-			}
-		}
-#endregion
 	}
 }
 #endif

+ 0 - 13
mcs/class/System.Web/System.Web.Configuration_2.0/CompilerCollection.cs

@@ -108,19 +108,6 @@ namespace System.Web.Configuration
 				return null;
 			}
 		}
-
-#region CompatabilityCode
-		[MonoTODO ("we shouldn't need this..")]
-		internal bool CompareLanguages (string lang1, string lang2)
-		{
-			return (this [lang1] == this [lang2]);
-		}
-
-		internal void Add (Compiler compiler)
-		{
-			BaseAdd (compiler);
-		}
-#endregion
 	}
 }
 #endif

+ 6 - 0
mcs/class/System.Web/System.Web.Hosting/ChangeLog

@@ -1,3 +1,9 @@
+2006-02-10 Gonzalo Paniagua Javier <[email protected]>
+
+	* DefaultVirtualPathProvider.cs: add some comments/TODO.
+	* HostingEnvironment.cs: initialize the default value for
+	VirtualPathProvider.
+
 2006-02-02 Gonzalo Paniagua Javier <[email protected]>
 
 	* HostingEnvironment.cs: MapPath is done.

+ 13 - 2
mcs/class/System.Web/System.Web.Hosting/DefaultVirtualPathProvider.cs

@@ -44,10 +44,13 @@ namespace System.Web.Hosting {
 		{
 		}
 
+		/*
+		 * No need to override this, it seems
 		public override string CombineVirtualPaths (string basePath, string relativePath)
 		{
 			return VirtualPathUtility.Combine (basePath, relativePath);
 		}
+		*/
 
 		public override bool DirectoryExists (string virtualDir)
 		{
@@ -86,7 +89,7 @@ namespace System.Web.Hosting {
 
 		public override string GetCacheKey (string virtualPath)
 		{
-			return null;
+			return null; // Always
 		}
 
 		public override VirtualDirectory GetDirectory (string virtualDir)
@@ -117,7 +120,15 @@ namespace System.Web.Hosting {
 
 		public override string GetFileHash (string virtualPath, IEnumerable virtualPathDependencies)
 		{
-			return null;
+			if (virtualPath == null || virtualPathDependencies == null)
+				throw new NullReferenceException ();
+
+			// No deps -> 1505
+			// Non-existing virtual deps -> 1505
+			// Relative virtual deps -> exception
+			// virtualPath does not matter at all (?)
+			// The number varies accross xsp executions
+			return virtualPath;
 		}
 	}
 }

+ 2 - 1
mcs/class/System.Web/System.Web.Hosting/HostingEnvironment.cs

@@ -45,7 +45,8 @@ namespace System.Web.Hosting {
 		static bool is_hosted;
 		static string site_name;
 		static ApplicationShutdownReason shutdown_reason;
-		static VirtualPathProvider vpath_provider; // This should get a default
+		static VirtualPathProvider vpath_provider = (HttpRuntime.AppDomainAppVirtualPath == null) ? null :
+								new DefaultVirtualPathProvider ();
 
 		public HostingEnvironment ()
 		{

+ 13 - 0
mcs/class/System.Web/System.Web.UI/ChangeLog

@@ -1,3 +1,16 @@
+2006-02-10 Gonzalo Paniagua Javier <[email protected]>
+
+	* IThemeResolutionService.cs: this is now added to the
+	sources file, but some other stuff does not compile yet as the
+	interface changed after the beta.
+
+	* ObjectConverter.cs: removed extra attribute.
+
+	* ObjectStateFormatter.cs: add IStateFormatter for 2.0.
+
+	* ICallbackEventHandler.cs: update the interface, but commented the
+	'good' stuff out, since other files need to be fixed too.
+
 2006-02-07  Chris Toshok  <[email protected]>
 
 	* ControlBuilder.cs: rename flushOutputStatements to

+ 2 - 0
mcs/class/System.Web/System.Web.UI/ICallbackEventHandler.cs

@@ -35,6 +35,8 @@ namespace System.Web.UI
 {
 	public interface ICallbackEventHandler
 	{
+		//string GetCallbackResult ();
+		//void RaiseCallbackEvent (string eventArgs);
 		string RaiseCallbackEvent (string eventArgs);
 	}
 }

+ 3 - 2
mcs/class/System.Web/System.Web.UI/IThemeResolutionService.cs

@@ -36,8 +36,9 @@ namespace System.Web.UI
 {
 	public interface IThemeResolutionService
 	{
-		ThemeProvider [] GetAllThemeProviders ();
-		ThemeProvider GetThemeProvider ();
+		//ThemeProvider [] GetAllThemeProviders ();
+		//ThemeProvider GetStylesheetThemeProvider ();
+		//ThemeProvider GetThemeProvider ();
 	}
 }
 #endif

+ 0 - 3
mcs/class/System.Web/System.Web.UI/ObjectConverter.cs

@@ -35,9 +35,6 @@ namespace System.Web.UI {
 	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	public sealed class ObjectConverter {
 
-#if NET_2_0
-		[Obsolete]
-#endif
 		public ObjectConverter ()
 		{
 		}

+ 10 - 6
mcs/class/System.Web/System.Web.UI/ObjectStateFormatter.cs

@@ -46,12 +46,16 @@ using System.Web.Util;
 using System.Diagnostics;
 
 namespace System.Web.UI {
-	#if NET_2_0
-		public
-	#else
-		internal
-	#endif
-	sealed class ObjectStateFormatter : IFormatter {
+#if NET_2_0
+	public
+#else
+	internal
+#endif
+	sealed class ObjectStateFormatter : IFormatter
+#if NET_2_0
+		, IStateFormatter
+#endif
+	{
 		public object Deserialize (Stream inputStream)
 		{
 			if (inputStream == null)

+ 1 - 0
mcs/class/System.Web/System.Web.dll.sources

@@ -548,6 +548,7 @@ System.Web.UI/IStyleSheet.cs
 System.Web.UI/ITagNameToTypeMapper.cs
 System.Web.UI/ITemplate.cs
 System.Web.UI/ITextControl.cs
+System.Web.UI/IThemeResolutionService.cs
 System.Web.UI/IUrlResolutionService.cs
 System.Web.UI/IUserControlDesignerAccessor.cs
 System.Web.UI/IUserControlTypeResolutionService.cs