How to use System.Net with code stripping?

Setting Unity’s stripping level to Strip Assemblies or Strip ByteCode from Player Settings → Optimization causes (at least) some of the System.Net functionality fail.

To test the issue, I created a simple project that only tries to use System.Net.WebRequest.Create():

using UnityEngine;
using System.Net;

public class NetworkAccessTest : MonoBehaviour
{
	void Start()
	{
		bool succeeded = false;
		try
		{
			WebRequest.Create("http://www.google.com"); 
			succeeded = true;
		}
		catch (System.Exception e)
		{
			Debug.Log(string.Format("Exception: {0}", e));
			succeeded = false;
		}
		Debug.Log(string.Format("Web request creation succeeded: {0}", succeeded));
	}
}

It works fine without stripping. But without sripping:


Exception: System.NotSupportedException: http://www.google.com/
  at System.Net.WebRequest.GetCreator (System.String prefix) [0x00000] in :0 
  at System.Net.WebRequest.Create (System.Uri requestUri) [0x00000] in :0 
  at System.Net.WebRequest.Create (System.String requestUriString) [0x00000] in :0 
  at NetworkAccessTest.Start () [0x00000] in :0 

The questions:

  1. Is it possible to use WebRequest and other networking classes from System.Net with code stripping?
  2. And if it’s possible, how?

It’s possible to list types that shouldn’t be stripped: docs.unity3d.com/Documentation/Manual/iphone-playerSizeOptimization.html. Would that solve the issue? How would I conveniently find out which types to list there? I can only think of reading the Mono source code and trying to deduce the missing types that could cause the expections.

Adding the following link.xml to Assets direcotry solves my little test case:

<linker>
	<assembly fullname="System">
		<type fullname="System.Net.HttpRequestCreator" preserve="all"/>		
	</assembly>
</linker>

I found the needed type by reading Mono sources for System.Net. Finding all necessary types for a large application is a pain in a neck, though, so any ideas on making that easier would be still appreciated.