It’s my link.xml info:
<linker>
<assembly fullname="System">
<type fullname="System.Net" preserve="all"/>
<type fullname="System.Threading" preserve="all"/>
<type fullname="System.Net.Sockets" preserve="all"/>
<type fullname="System.IO" preserve="all"/>
<type fullname="System.Text" preserve="all"/>
<type fullname="System.Collections" preserve="all"/>
<type fullname="System.Collections.Generic" preserve="all"/>
<type fullname="System.Net.WebRequest" preserve="all"/>
<type fullname="System.Configuration.ExeConfigurationHost" preserve="all"/>
<type fullname="System.Configuration" preserve="all"/>
</assembly>
</linker>
It’s the problem(for xcode throw):
Loading /var/mobile/Applications/5A35737D-ECB3-4C4E-9219-6E18D5D87D63/COD0506t2.app/Data/Managed/System.Data.dll
into Unity Child Domain
- Completed reload, in 0.171 seconds
-> applicationDidBecomeActive()
Unhandled Exception: System.TypeInitializationException: An exception was thrown by the type initializer for
System.Net.WebRequest ---> System.Configuration.ConfigurationErrorsException: Error Initializing the configuration system. ---> System.MissingMethodException: Method not found: 'Default constructor not found...ctor() of System.Configuration.ExeConfigurationHost'.
at System.Activator.CreateInstance (System.Type type, Boolean nonPublic) [0x00000] in <filename unknown>:0
at System.Activator.CreateInstance (System.Type type) [0x00000] in <filename unknown>:0
at System.Configuration.InternalConfigurationSystem.Init (System.Type typeConfigHost, System.Object[] hostInitParams) [0x00000] in <filename unknown>:0
at System.Configuration.InternalConfigurationFactory.Create (System.Type typeConfigHost, System.Object[] hostInitConfigurationParams) [0x00000] in <filename unknown>:0
at System.Configuration.ConfigurationManager.OpenExeConfigurationInternal (ConfigurationUserLevel userLevel, System.Reflection.Assembly calling_assembly, System.String exePath) [0x00000] in <filename unknown>:0
at System.Configuration.ClientConfigurationSystem.get_Configuration () [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at System.Configuration.ClientConfigurationSystem.get_Configuration () [0x00000] in <filename unknown>:0
at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection (System.String configKey) [0x00000] in <filenameunknown>:0
at System.Configuration.ConfigurationManager.GetSection (System.String sectionName) [0x00000] in <filename unknown>:0
at System.Net.WebRequest..cctor () [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at Net.Http.HttpUtil.GetHttp (System.String httpUrl) [0x00000] in <filename unknown>:0
at Net.NetManager.ExecuteGetHttp () [0x00000] in <filename unknown>:0
Clark
(Filename: /Applications/buildAgent/work/14194e8ce88cdf47/Runtime/ExportGenerated/iPhonePlayer-armv7/UnityEngineDebug.cpp Line: 43)
-> force accelerometer registration
The game I’m working on using several classes from the System.Net.Sockets package. If I run it on a normal build it works perfectly, but if I try to strip it using either StrippingLevel.StripAssemblies or StrippingLevel.StripByteCode stripping levels, it crashes with a*exception (above…).
But, why?
Additional Information:
1, I have implemented Http using System.Net.Sockets.
2, When I use my link.xml, the size of System.dll is increased (259kb).
3, When I only use [StrippingLevel.StripByteCode], the size of System.dll is small (252kb).
4, When I disable the [strip function], the size of System.dll is biggest (1.7m).