48 Commits
Author SHA1 Message Date
Maxim Lipnin c890be00c9 use for loop to access item values and avoid InvalidCastException which occurs because VirtualDirectoryMappingCollection enumerator returns key and it's not expected 2019-02-19 21:08:02 +01:00
Pablo Ruiz García db758b9f85 Fix OpenMappedWebConfiguration throws: System.IndexOutOfRangeException, when using RazorGenerator under mono (#5013) 2017-06-12 01:55:26 +02:00
Zoltan Varga 0985d4aa4b [bcl] Remove NET_2_0 defines from the class libs. This has been done using: unifdef -t -DNET_2_0 -o <filename> <filename>. 2015-01-13 15:29:38 -05:00
Etienne CHAMPETIER 227b0d1b55 [cleanup] System.Web*: remove TARGET_J2EE
done using unifdef
git grep -l TARGET_J2EE | grep -v ChangeLog | xargs -n1 unifdef -m -UTARGET_J2EE

Signed-off-by: Etienne CHAMPETIER <[email protected]>
2014-12-01 23:57:18 +01:00
QuickJack cd2c570c55 Allows write access to web.config files below an app's root. 2012-01-10 21:01:16 +01:00
Martin 3a604b81c5 http://bugzilla.xamarin.com/show_bug.cgi?id=2345 2011-12-12 13:12:07 +01:00
Marek Habersack 7662f68051 [asp.net] Shorten code in WebConfigurationHost 2011-04-14 20:49:30 +02:00
Marek Habersack c04e994ef6 [asp.net] A more effective way of looking for web.config 2011-04-13 16:56:37 +02:00
Marek Habersack 4f20ce19f2 [asp.net] Partial fix for bug #575600. Support opening another app configuration.
WebConfigurationHost now supports one more parameter passed to it in InitForConfiguration -
a boolean telling whether the configuration being initialized belongs to another app. If it is
true then the virtual path passed to InitForConfiguration is used as the application virtual
path. This has the effect that IsDefinitionAllowed doesn't throw an exception when a configuration
element with the MachineToApplication level is parsed.
WebConfigurationManager.FindWebConfig checks whether the path passed to it belongs to this application
which allows the mechanism described in the first paragraph to work.
2010-08-11 22:23:49 +02:00
Jb Evain b87bd5ff29 [Perf] avoid an exception when reading a non existent app configuration
Make implementors of IInternalConfigurationHost.OpenStreamForRead return null instead of throwing an exception when there's no usable configuration file and deal with null at the call site.
2010-08-06 17:27:40 +02:00
Marek Habersack e87f70514a 2010-02-12 Marek Habersack <[email protected]>
* WebConfigurationHost.cs: implemented {Encrypt,Decrypt}Section

svn path=/trunk/mcs/; revision=151604
2010-02-12 12:01:58 +00:00
Marek Habersack 692b3e376b 2010-01-09 Marek Habersack <[email protected]>
* WebConfigurationManager.cs: GetSection properly handles looking
	up and caching of <location> instances. Part of fix for bug
	#568441

	* WebConfigurationHost.cs: GetConfigPathFromLocationSubPath
	calculatesthe path relative to the current config file path. Part
	of fix for bug #568441

2010-01-09  Marek Habersack  <[email protected]>

	* VirtualPathUtility.cs: small optimizations for GetDirectory

2010-01-09  Marek Habersack  <[email protected]>

	* ConfigurationLocation.cs: trailing / characters are removed from
	the path.

	* Configuration.cs: instances created for locations inherit
	ConfigPath from their containing document.
	Host.GetConfigPathFromLocationSubPath must be called with current
	instance's configPath, not LocationConfigPath.
	Locations are sought for using paths relative to the current
	instance's configPath, not to the root path.
	All of the above is part of fix for bug #568441

svn path=/trunk/mcs/; revision=149262
2010-01-09 00:29:25 +00:00
Marek Habersack 0dd5890dab 2009-11-19 Marek Habersack <[email protected]>
* LogicalTypeInfo.cs: removed the JsonResult class - it has no use
	and it can break applications (e.g. Umbraco)

2009-11-19  Marek Habersack  <[email protected]>

	* VirtualPathUtility.cs: made Normalize internal

2009-11-19  Marek Habersack  <[email protected]>

	* WebConfigurationHost.cs: IsDefinitionAllowed now normalizes the
	passed configuration path, so that MachineToApplication sections

	* WebConfigurationManager.cs: use an rw lock to protect access to
	sectionCache. This is now necessary as the save handler clears the
	cache.

svn path=/trunk/mcs/; revision=146546
2009-11-19 15:18:34 +00:00
Marek Habersack 01916d259e 2009-07-14 Marek Habersack <[email protected]>
* WebConfigurationManager.cs: added support for suppressing
	application reload when the main config file is written to from
	application.

	* WebConfigurationHost.cs: added minimal implementation of
	WriteCompleted, which checks if there's need to suppress
	application reload.

2009-07-14  Marek Habersack  <[email protected]>

	* ConfigurationSaveEventArgs.cs, ConfigurationSaveEventHandler.cs:
	added

	* Configuration.cs: added two internal events - SaveStart and
	SaveEnd. They are used by System.Web's configuration system to
	suppress application reloads when configuration is modified and
	saved from within a web application. It is necessary to use events
	since there is no guarantee the web application will use
	WebConfigurationManager (and thus WebConfigurationHost) for
	writing.

2009-07-14  Marek Habersack  <[email protected]>

	* System.Configuration.dll.sources: added
	System.Configuration/ConfigurationSaveEventArgs.cs
	System.Configuration/ConfigurationSaveEventHandler.cs

2009-07-14  Marek Habersack  <[email protected]>

	* AssemblyInfo.cs: added InternalsVisibleTo for System.Web

2009-07-14  Marek Habersack  <[email protected]>

	* HttpApplicationFactory.cs: OnFileChanged doesn't reload
	application if reload suppression is active.

svn path=/trunk/mcs/; revision=137847
2009-07-14 11:24:36 +00:00
Gonzalo Paniagua Javier 3d7ff5cc84 2009-07-09 Gonzalo Paniagua Javier <[email protected]>
* WebConfigurationHost.cs: null means MachineToApplication.
	* WebConfigurationManager.cs: when caching configuration and sections,
	use the configuration file directory instead of the incoming request
	path.


svn path=/trunk/mcs/; revision=137632
2009-07-09 17:10:07 +00:00
Marek Habersack eb01ce450f 2009-01-26 Marek Habersack <[email protected]>
* WebConfigurationHost.cs: when an attempt to map a fake virtual
	path is made, MapPath returns the aplication physical root
	directory. Fixes bug #463950

svn path=/trunk/mcs/; revision=124479
2009-01-26 11:38:08 +00:00
Marek Habersack a3e3e7976c 2008-12-24 Marek Habersack <[email protected]>
* WebConfigurationManager.cs: A better version of the previous
        GetSection fix. Right now the method searches for directories
        containing web.config and uses them, if found, to open the web
        configuration. If no web.config is found, web configuration is
        opened for the root application directory.

        * WebConfigurationHost.cs: made GetWebConfigFileName internal
        static, so that code can be reused from WebConfigurationManager.

svn path=/trunk/mcs/; revision=122124
2008-12-25 13:02:15 +00:00
Marek Habersack 55a73972c1 2008-12-16 Marek Habersack <[email protected]>
* WebConfigurationHost.cs: IsDefinitionAllowed should treat
	configPath == "~" as the root application path.

svn path=/trunk/mcs/; revision=121636
2008-12-16 22:00:56 +00:00
Marek Habersack 99cdf04336 2008-05-22 Marek Habersack <[email protected]>
* WebConfigurationHost.cs: changed CreateDeprecatedConfigContext
        to return a new HttpContext object. This is part of a fix for bug 
        #325128. Patch contributed by James Fitzsimons <[email protected]>,
        thanks!

svn path=/trunk/mcs/; revision=104332
2008-05-28 21:23:54 +00:00
Konstantin Triger 5ba2dc9b66 TARGET_JVM: use J2EEUtils.InputStreamWrapper for reading java's InputStream
svn path=/trunk/mcs/; revision=92588
2008-01-10 15:10:44 +00:00
Konstantin Triger d652e07430 use ClassLoader.getResourceAsStream instead of ClassLoader.getResource for checking resource presence to remove leaks
svn path=/trunk/mcs/; revision=92386
2008-01-07 13:36:15 +00:00
Noam Lampert e77d4c28c0 Fix Java compilation
svn path=/trunk/mcs/; revision=87647
2007-10-17 10:51:37 +00:00
Marek Habersack f3a1e77fcc 2007-10-17 Marek Habersack <[email protected]>
* ApplicationHost.cs: introduce an application domain data item to
	allow checks for whether System.Web code runs inside a hosted
	application or in a stand-alone one.
	Made the array of web.config name variations an internal one, to
	be used from within configuration code.

2007-10-17  Marek Habersack  <[email protected]>

	* WebConfigurationHost.cs: if running outside hosted environment,
	read only the assemblyname.config configuration file instead of
	web.config. Fixes bug #332425

svn path=/trunk/mcs/; revision=87621
2007-10-16 22:34:48 +00:00
Igor Zelmanovich 318f6b2099 2007-05-17 Igor Zelmanovich <[email protected]>
* WebConfigurationHost.cs: for TARGET_J2EE only:
	prevent NullRefference Exception.


svn path=/trunk/mcs/; revision=77541
2007-05-17 12:04:52 +00:00
Igor Zelmanovich ae1457b6dd 2007-05-15 Igor Zelmanovich <[email protected]>
* WebConfigurationManager.cs: 
	make configurations hashtable case-insensitive.
	* WebConfigurationHost.cs: for TARGET_J2EE only:
	GetStreamName returns file path in right case, that make it works 
	on case-sensitive file system.

	* ConfigurationLocationCollection.cs: for TARGET_JVM only:
	location path is case-insensitive.
		
	* PageMapper.cs: reverted r77353, 77321
	make it case-insensitive


svn path=/trunk/mcs/; revision=77415
2007-05-15 14:58:27 +00:00
Marek Habersack c7d897bbf4 2007-05-15 Marek Habersack <[email protected]>
* TemplateParser.cs: refactoring - use HttpApplication.LoadType to
	actually look up types.
	
	* ControlBuilder.cs: as above

2007-05-15  Marek Habersack  <[email protected]>

	* BuildProviderCollection.cs: refactoring - use
	HttpApplication.LoadType to actually look up the type.

	* HttpHandlerAction.cs: as above

	* WebConfigurationHost.cs: refactoring - moved the LoadType to
	HttpApplication to share the code between 1.1 and 2.0 profiles.

2007-05-15  Marek Habersack  <[email protected]>

	* ObjectDataSourceView.cs: refactoring - use
	HttpApplication.LoadType to look up types.

2007-05-15  Marek Habersack  <[email protected]>

	* HttpApplication.cs: refactoring - moved LoadType from
	WebConfigurationHost here and made it internal static, in order to
	make the code avaliable from all the places where extended type
	loading is required.


svn path=/trunk/mcs/; revision=77396
2007-05-15 09:35:00 +00:00
Konstantin Triger 697b12d28a Do not intercept the original exception
svn path=/trunk/mcs/; revision=76557
2007-05-02 09:42:51 +00:00
Marek Habersack ae40e973db 2007-04-24 Marek Habersack <[email protected]>
* WebConfigurationHost.cs: Look for types in the top-level assemblies (App_Code and
	friends).

svn path=/trunk/mcs/; revision=76165
2007-04-24 07:36:19 +00:00
Marek Habersack aef2ee73d1 2007-04-24 Marek Habersack <[email protected]>
* HttpRequest.cs: MS.NET throws HttpException for invalid paths,
	not ArgumentNullException.

	* HttpException.cs: wrap GetHtmlErrorMessage internals in
	try/catch to capture possible exceptions in HttpContext.

	* HttpContext.cs: IsCustomErrorEnabled is used from within
	HttpException, make sure it gets the section in a safe way and
	resorts to the default settings.
	
	* HttpResponse.cs: HeaderEncoding is used in the same context as
	above. Take the same precautions.

2007-04-24  Marek Habersack  <[email protected]>

	* WebConfigurationHost.cs: wrap MapPath calls in try/catch,
	because bad URLs can cause it to throw exceptions. If such
	exception is caught, throw a HttpException for Bad Request (400).

	* WebConfigurationManager.cs: added two internal methods for safe
	retrieval of config sections.


svn path=/trunk/mcs/; revision=76162
2007-04-24 06:54:27 +00:00
Konstantin Triger 916e6fa9fd logically move the *.config files under META-INF folder
svn path=/trunk/mcs/; revision=75768
2007-04-16 15:17:31 +00:00
Marek Habersack c7bbc99b2a 2007-03-24 Marek Habersack <[email protected]>
* WebConfigurationManagerTest.cs: the tests don't work because of
	the way the test suite is set up. In a normal application, the
	three test would work just fine.

2007-03-24  Marek Habersack  <[email protected]>

	* HttpRuntime.cs: use ICalls.GetMachineConfigPath instead of
	opening the machine.config file and getting its path.

	* CapabilitiesLoader.cs: use HttpRuntime.MachineConfigurationDirectory 
	instead of opening the machine config file and getting its path.

2007-03-24  Marek Habersack  <[email protected]>

	* WebConfigurationHost.cs: allow MachineToApplication definition
	for config paths that equal the domain virtual app directory.


svn path=/trunk/mcs/; revision=74927
2007-03-24 01:01:57 +00:00
Konstantin Triger 4de36b8ec4 TARGET_J2EE: enable embedding web.config into a jar
svn path=/trunk/mcs/; revision=74552
2007-03-18 10:24:47 +00:00
Konstantin Triger 97c7afddd6 return null for global web.config for TARGET_JVM
svn path=/trunk/mcs/; revision=70079
2006-12-26 12:35:20 +00:00
Miguel de Icaza 8616a7e405 2006-11-28 Miguel de Icaza <[email protected]>
* Rationalize the user of MonoTODOs.  

		- Removed all the TODOs that were only overwritten methods
		and had no further information.

		- Methods that threw exceptions now have the message "Not
		implemnted".

		- Methods that return some constant are declared like
		that.

		- Removed a bunch of stale MonoTODOs that had not been
		removed. 


svn path=/trunk/mcs/; revision=68620
2006-11-28 22:15:23 +00:00
Konstantin Triger f32b219d7a use Type.GetType for loading full qualified types since Assembly.GetType() fails to load them
svn path=/trunk/mcs/; revision=67749
2006-11-13 10:35:51 +00:00
Miguel de Icaza fefa8b8300 Add LoadType implementation, from #79396, this should be refactored
svn path=/trunk/mcs/; revision=67242
2006-11-01 20:48:06 +00:00
Konstantin Triger cbf7754273 do not recourse as this will be done by Configuration object
svn path=/trunk/mcs/; revision=65022
2006-09-06 17:56:41 +00:00
Konstantin Triger 2c232263cf revert TARGET_JVM ifdef
svn path=/trunk/mcs/; revision=64295
2006-08-24 10:51:12 +00:00
Vladimir Krasnov 9a0b452068 * WebConfigurationManager.cs: added configSystem property under TARGET_JVM part
* WebConfigurationHost.cs: fixed GetStreamName and OpenStreamForRead for TARGET_JVM
* CompilationSection.cs: BuildProviders property removed from TARGET_JVM
* SystemWebSectionGroup.cs: Compilation property removed from TARGET_JVM

svn path=/trunk/mcs/; revision=63495
2006-08-08 16:48:57 +00:00
Chris Toshok 9887d4c832 2006-06-08 Chris Toshok <[email protected]>
* WebConfigurationHost.cs (InitForConfiguration): i know this is
	going to bite me in the ass, but guard against configPath being ==
	to "/", since this will result in an infinite loop.
	(MapPath): fix a NRE.


svn path=/trunk/mcs/; revision=61574
2006-06-08 14:50:38 +00:00
Chris Toshok 58228fbaa3 2006-05-04 Chris Toshok <[email protected]>
[ Fixes bug #78256 ]
	
	* WebConfigurationHost.cs (GetConfigType): add a MonoTODO about
	how we should use the build provider machinery to get types.
	(MapPath): add rudimentary mapping in the case where we don't have
	a request, basically handle the case where the url begins with (or
	is) HttpRuntime.AppDomainAppVirtualPath.

	* WebConfigurationManager.cs (GetSection): if we don't have a
	valid request, open the web configuration corresponding to
	HttpRuntime.AppDomainAppVirtualPath.
	(GetBasePath): comment this a little, and make it work in the case
	where we don't have an HttpRequest.


svn path=/trunk/mcs/; revision=60275
2006-05-04 19:02:05 +00:00
Chris Toshok 1de2e66006 * WebConfigurationHost.cs (InitForConfiguration): actually, use
HttpRuntime.AppDomainAppVirtualPath on gonzalo's recommendation.
	It's never null, and its use cleans things up a bit.

2006-04-25  Chris Toshok  <[email protected]>


svn path=/trunk/mcs/; revision=59878
2006-04-25 21:50:08 +00:00
Chris Toshok a8c07f9b53 2006-04-25 Chris Toshok <[email protected]>
* WebConfigurationHost.cs (InitForConfiguration): stop going up
	the virtual hierarchy once we reach the application's base virtual
	path.


svn path=/trunk/mcs/; revision=59876
2006-04-25 21:39:33 +00:00
Chris Toshok 463b9cef4a 2006-03-24 Chris Toshok <[email protected]>
* WebConfigurationHost.cs: fix bug where OpenWebConfiguration
	("/") would result in 2 configurations for that toplevel path to
	be opened.


svn path=/trunk/mcs/; revision=58491
2006-03-24 21:05:41 +00:00
Chris Toshok 7033a6044e 2006-01-30 Chris Toshok <[email protected]>
* WebConfigurationManager.cs: lots of little changes.  hopefully
	this doesn't break anyone.  it fixes all the nunit problems
	gonzalo was having.

	* WebConfigurationHost.cs (GetStreamName): in the MachineWebPath
	case, handle the case where we have a WebConfigurationFileMap.
	(MapPath): this is likely wrong, but in the case where we don't
	have a file map or current HttpContext, just return the path.


svn path=/trunk/mcs/; revision=56311
2006-01-31 06:05:14 +00:00
Chris Toshok ea89719776 2006-01-26 Chris Toshok <[email protected]>
* HttpConfigurationSystem.cs: new class that gets sections from
	web.config files.

	* WebConfigurationManager.cs: change a lot of the
	NotImplementedExceptions to NotSupportedExceptions.
	(AppSettings): implement by just returning
	ConfigurationManager.AppSettings (note this is broken because
	ConfigurationManager.AppSettings are read-only, but it works for
	reading.)
	(ConnectionStrings): same (and probably broken in the same way..)
	(Init): replace the 2.0 IInternalConfigSystem with our
	HttpConfigurationSystem.

	* WebConfigurationHost.cs: add a comment about how things are
	likely to work in the face of IRemoteWebConfigurationHostServer.
	(CreateConfigurationContext): return a WebContext instance.


svn path=/trunk/mcs/; revision=56137
2006-01-27 02:17:41 +00:00
Chris Toshok 05d5389878 2006-01-16 Chris Toshok <[email protected]>
* WebConfigurationManager.cs: implement a IConfigurationSystem for
	use with WebConfigurationManager.
	(GetSection): try to load the section
	using GetWebApplicationSection before calling into
	ConfigurationManager.GetSection.
	(GetWebApplicationConfiguration): move common code to here.
	(GetWebApplicationSection): use GetWebApplicationConfiguration.
	(AppSettings): implement.

	* WebConfigurationHost.cs (GetWebConfigFileName): add
	"Web.Config", and move to an array/loop implementation.  maybe we
	should scan the directory and check ToLower() instead of
	explicitly enumerating?


svn path=/trunk/mcs/; revision=55650
2006-01-16 20:11:14 +00:00
Chris Toshok 28685b1020 move many 2.0-only classes into System.Web.Configuration_2.0
svn path=/trunk/mcs/; revision=52421
2005-10-31 21:03:10 +00:00