Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by LaurieMcC · May 21, 2014 at 03:42 PM · ioshttpwebrequeststripping

HTTP WebRequest with iOS Stripping

httpWebRequest works fine for me on iOS device until I turn on code stripping.

I have seen conflicting posts, some of them admittedly quite old, as to whether this can be made to work.

I have tried to identify and and add required types and namespace to the link.xml file. But haven't managed to get this to work yet. It might just be my syntax or chosen namespaces.

Can anybody confirm if they have managed to get this to work.

The error I am getting is

System.TypeInitializationException: An exception was thrown by the type initializer for System.Net.WebRequest ---> System.Exception: Error Initializing the configuration system. ---> System.Exception: Method not found: 'Default constructor not found...ctor() of System.Configuration.ExeConfigurationHost'. at System.Activator.CreateInstance (System.Type type, Boolean nonPublic) [0x00000] in :0 at System.Activator.CreateInstance (System.Type type) [0x00000] in :0 at System.Configuration.InternalConfigurationSystem.Init (System.Type typeConfigHost, System.Object[] hostInitParams) [0x00000] in :0 at System.Configuration.InternalConfigurationFactory.Create (System.Type typeConfigHost, System.Object[] hostInitConfigurationParams) [0x00000] in :0 at System.Configuration.ConfigurationManager.OpenExeConfigurationInternal (ConfigurationUserLevel userLevel, System.Reflection.Assembly calling_assembly, System.String exePath) [0x00000] in :0 at System.Configuration.ClientConfigurationSystem.get_Configuration () [0x00000] in :0 --- End of inner exception stack trace --- at System.Configuration.ClientConfigurationSystem.get_Configuration () [0x00000] in :0 at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection (System.String configKey) [0x00000] in :0 at System.Configuration.ConfigurationManager.GetSection (System.String sectionName) [0x00000] in :0 at System.Net.WebRequest..cctor () [0x00000] in :0 --- End of inner exception stack trace ---

My link.xml currently contains the following, but event that is throwing the error above.

    <assembly fullname="mscorlib">
                <namespace fullname="System.Security.Cryptography" preserve="all"/>
                <namespace fullname="System.Threading" preserve="all"/>
                <namespace fullname="System.Activator" preserve ="all"/>
                <namespace fullname="System.Activator.CreateInstance" preserve ="all"/>
    </assembly>
    <assembly fullname="System">
               <namespace fullname="System.Threading" preserve="all"/>
            <namespace fullname="System.Net.Configuration.WebRequestModuleHandler" preserve="all"/>
            <namespace fullname="System.Net.HttpRequestCreator" preserve="all"/>
            <namespace fullname="System.Net.FileWebRequestCreator" preserve="all"/>
            <namespace fullname="System.Net" preserve="all"/>
            <namespace fullname="System.Net.WebRequest" preserve="all"/>
            <namespace fullname="System.Collections" preserve="all"/>
            <namespace fullname="System.Collections.Generic" preserve="all"/>
            <namespace fullname="System.Runtime.ConstrainedExecution.CriticalFinaliserObject" preserve="all"/>
            <namespace fullname="System.IO" preserve="all"/>
            <namespace fullname="System.Text" preserve="all"/> 
            <namespace fullname="System.Runtime.InteropServices" preserve="all"/>
            <namespace fullname="System.Runtime.Serialization.ISerializable" preserve="all"/>
            <namespace fullname="System.Activator.CreateInstance" preserve ="all"/>
            <namespace fullname="System.Configuration" preserve="all"/>
    </assembly>
    <assembly fullname="System.Web.Services">
            <type fullname="System.Web.Services.Protocols.SoapTypeStubInfo" preserve="all"/>
            <type fullname="System.Web.Services.Configuration.WebServicesConfigurationSectionHandler" preserve="all"/>
    </assembly>
    <assembly fullname="System.Configuration">
            <namespace fullname="System.Configuration.ExeConfigurationHost" preserve="all"/>
            <namespace fullname="System.Configuration.ClientConfigurationSystem" preserve="all"/>
            <namespace fullname="System.Configuration.ConfigurationManager.GetSection" preserve="all"/>
            <namespace fullname="System.Configuration" preserve="all"/>
    </assembly>

 
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by GrayedFox · Oct 22, 2014 at 01:40 PM

Hi there LaurieMcC, I cannot confirm whether the appropriate link.xml file references will allow System.Net.* stuff to work alongside stripping, but I can confirm that Unity's inbuilt WWW class can, in almost all instances, replace any System.Web or System.Net functionality. We started stripping our app to reduce file size and just ended up replacing all instances of .Net calls with WWW and now it works fine.

Well... except for this nasty System.Web.Extensions reference in our serialiser :(

Good luck

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

21 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

About Implemented host name resolution with IPv6 in Unity 4.6.9 release-notes. 0 Answers

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

link.xml for a monobehaviour? 1 Answer

What's the smallest possible iOS file size after Unity Pro Stripping 1 Answer

Failed to load AOT module ... in aot-only mode. 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges