Bug 11972 - HttpUtility.ParseQueryString() causes subsequent ConfigurationManager.AppSettings calls to fail
Summary: HttpUtility.ParseQueryString() causes subsequent ConfigurationManager.AppSett...
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.Web (show other bugs)
Version: master
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-04-25 15:43 UTC by Andres G. Aragoneses
Modified: 2013-11-15 06:46 UTC (History)
2 users (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments

Description Andres G. Aragoneses 2013-04-25 15:43:05 UTC
Given the App.config is:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
	<appSettings>
		<add key="SomeKey" value="value" />
	</appSettings>
</configuration>

This test fails at the last (3rd) assertion:

    [TestFixture]
    public class Tests
    {
		[Test]
		public void Access_app_setting_fails_after_calling_parse_query_string()
		{
			Assert.That (ConfigurationManager.AppSettings["SomeKey"], Is.Not.Null, "Null on first try");
			Assert.That (HttpUtility.ParseQueryString("example.com?query=value"), Is.Not.Null);
			Assert.That (ConfigurationManager.AppSettings["SomeKey"], Is.Not.Null, "Null on second try");
		}
    }
Comment 1 Andres G. Aragoneses 2013-11-15 06:46:36 UTC
>Kris Krause <kris.krause@....com> changed:
>
>           What    |Removed                     |Added
>----------------------------------------------------------------------------
>                 CC|                            |kris.krause@....com

Hi Kris

In case you're interested, there was a PR from me some time ago to fix this:

https://github.com/mono/mono/pull/643

Problem is, I don't think anymore that the approach I used is the correct one. So if you want to maybe try finding the proper fix, you can see the discussions in the pull-request about how I think the approach should be. Unfortunately I haven't found time yet to keep working on this.

Note You need to log in before you can comment on or make changes to this bug.