Search Issue Tracker

Postponed means that the issue was either a feature request or something that requires major refactoring on our side. Since that makes the issue not actionable in the close future we choose to close it as Postponed and add it on our internal roadmaps and technical debt pages instead.

Postponed

Votes

3

Found in

5.2.0f3

Issue ID

726371

Regression

No

IL2CPP crashes when using SmtpClient

IL2CPP

-

How to reproduce:

1. Open a new project
2. Import the attached script (SendMail.cs)
3. In the Player Settings set the Api Compatibility Level to .Net 2.0
4. Build to iOS and run
- Note the error thrown:
MissingMethodException: Method not found: 'Default constructor not found...ctor() of System.Net.Configuration.MailSettingsSectionGroup'.

Comments (9)

  1. 85e4ce3895f29cd32783a229dcf4563e?d=mm

    unnanego

    Oct 17, 2018 11:49

    Link worked for me with 2018.2.11 and iOS 12. Had a problem with an invisible symbol appearing when copying from the forum post regarding the issue and having to add the fourth line - paste pay attention to this if link is not helping.

  2. C05f193835e72cd1d25d7c49b4c403f9?d=mm

    dorukeker

    Apr 20, 2018 12:06

    The workaround with link.xml worked.
    file content:

    <linker>
    <assembly fullname="System">
    <type fullname="System.Net.Configuration.MailSettingsSectionGroup" preserve="all"/>
    <type fullname="System.Net.Configuration.SmtpSection" preserve="all"/>
    <type fullname="System.Net.Configuration.SmtpNetworkElement" preserve="all"/>
    <type fullname="System.Net.Configuration.SmtpSpecifiedPickupDirect‌oryElement" preserve="all"/>
    </assembly>
    </linker>

    Also added the below to my script.
    using System.Net.Configuration

  3. 54080edaba9b8d3e02e9bdcb5d4838f5?d=mm

    awardell

    Jan 26, 2018 03:22

    This is still an issue, and the link.xml file workaround no longer works. Instead, I had to use the solution here: https://fogbugz.unity3d.com/default.asp?837009_jo48ot1ti6mbc4a4 as well as create a dummy method for forcing the default constructors to be included:

    public void Includes()
    {
    var incl0 = new System.Net.Configuration.MailSettingsSectionGroup();
    var incl1 = new System.Net.Configuration.SmtpSection();
    var incl2 = new System.Net.Configuration.SmtpNetworkElement();
    }

    Is Unity Technologies ever going to address this issue?

  4. 6cb622548885e30d25ce0396a7628f77?d=mm

    garrahan

    Nov 23, 2017 17:27

    OK the link.xml solution did seem work for WebGL

    Set api level to .Net 2.0

    Make a "link.xml" and place in your assets folder.

    <linker>
    <assembly fullname="System">
    <type fullname="System.Net.Configuration.MailSettingsSectionGroup" preserve="all"/>
    <type fullname="System.Net.Configuration.SmtpSection" preserve="all"/>
    <type fullname="System.Net.Configuration.SmtpNetworkElement" preserve="all"/>
    </assembly>
    </linker>

  5. 6cb622548885e30d25ce0396a7628f77?d=mm

    garrahan

    Nov 23, 2017 17:17

    Still having the issue with in WebGL. 5.6.2f1 Says the 'Default constructor not found...ctor() of System.Net.Configuration.MailSettingsSectionGroup'.

    I did try the link.xml solution but still not work.

  6. 4eeb66cd13f3860a29325585353fd113?d=mm

    Protozoaire

    Mar 20, 2017 08:19

    Like Friflo, spent a day before getting to this Unity issue workaround. Nov 20, 2015? Bug still present on Unity 5.5.0f3 Mar 20, 2017.

  7. 9d24ab816610d972d16548500f56deb8?d=mm

    fmathews34

    Jul 14, 2016 17:29

    was this resolved? because i am getting the same issue in my webGL build

  8. D523dfb48a76fcc7c78735bae4d21780?d=mm

    friflo

    Jan 24, 2016 21:35

    Had same issue. A similiar exception text is "Failed to fast create instance for type ..."
    when using Activator.CreateInstance().
    Spend some hours before getting to this issue report :)
    btw: using link.xml is really only a workaround.

  9. 8b1a42e8bcbf816696f60a10cfa3b940?d=mm

    JoshPeterson

    Nov 20, 2015 12:36

    Note that it is possible to work around this bug by using the following link.xml file:

    <linker>
    <assembly fullname="System">
    <type fullname="System.Net.Configuration.MailSettingsSectionGroup" preserve="all"/>
    <type fullname="System.Net.Configuration.SmtpSection" preserve="all"/>
    <type fullname="System.Net.Configuration.SmtpNetworkElement" preserve="all"/>
    </assembly>
    </linker>

    More details about the link.xml file are available here: http://docs.unity3d.com/Manual/iphone-playerSizeOptimization.html

    Once this bug is corrected, this link.xml file will not be necessary.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.