I have added System.HttpApplication.RegisterModule(), the missing two properties of the System.Web.Routing.RouteCollection as well as the corresponding property in the HttpRuntimeSection to completely turn this off. Microsofts MIT-Licensed counterparts of the official System.Web assembly from github [0] were used as a reference. It is kind-of bolted on, but should be good enough until the whole open-sourced System.Web is incorporated. It should at least get the default MVC5 Template from Visual Studio 2013 up and running, once the async pipeline for the owin stuff is fixed.
[0]: http://github.com/Microsoft/referencesource/
Additionally, the MissingMethodException "get_InClientBuildManager" in System.Web.Hosting.HostingEnvironment was fixed.
In this commit, the following bugs were fixed:
https://bugzilla.xamarin.com/show_bug.cgi?id=21810https://bugzilla.xamarin.com/show_bug.cgi?id=16475
The section mapping system wasn't being initialized and used properly since some ifdefs had
been left in the source code. This caused a null reference exception while trying to perform
some HTTP requests and, as the result, broke Xamarin Studio activation.
As suggested by Marek Habersack, instead of catching
SynchronizationLockException in the case that the lock wasn't
acquired, we now have a boolean that indicates if it was
acquired or not, so we can act on it on the finally{} block.
System.Web.ConfigurationManager had a cache which didn't have any max limit,
therefore when using Restful URIs in ASP.NET (like having some variable
parameter in the virtual path, i.e. /user/{userId}/tracks, where {userId}
is a variable Integer) this was very likely to cause a leak which would
end up causing troubles, like an InvalidCastException thrown by
HttpApplication::PreStart()
(Read operations in the cache now cause a write operation on the cache
object, so all sectionCache lock-read usages are converted to lock-write.)
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=5598
System.Web.ConfigurationManager had a cache which didn't have any max limit,
therefore when using Restful URIs in ASP.NET (like having some variable
parameter in the virtual path, i.e. /user/{userId}/tracks, where {userId}
is a variable Integer) this was very likely to cause a leak which would
end up causing troubles, like an InvalidCastException thrown by
HttpApplication::PreStart()
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=5598
Following is a step by step guide to create a testing project:
(1) Create an ASP.NET project in MonoDevelop
(2) Create a folder "base"
(3) Create two subfolders called "sub1" and "sub2" inside of "base"
(4) Create a web.config file in both sub folders "sub1" and "sub2" and enter the following code:
<configuration>
<appSettings>
<add key="myText" value="src=sub1"/>
</appSettings>
</configuration>
Set the "value=" element to the appropriate value of the corresponding sub folder.
(5) Enter the following code in Default.aspx.cs
public void Page_Load(object sender, EventArgs args)
{
//c2.ConfigPath contains wrong path
Configuration c1 = WebConfigurationManager.OpenWebConfiguration("~/base/sub1");
Configuration c2 = WebConfigurationManager.OpenWebConfiguration("~/base/sub2");
//myText_sub2 refers to the wrong AppSettings entry
KeyValueConfigurationElement myText_sub1 = (KeyValueConfigurationElement)c1.AppSettings.Settings["myText"];
KeyValueConfigurationElement myText_sub2 = (KeyValueConfigurationElement)c2.AppSettings.Settings["myText"];
}