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
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'.
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- PlasticSCM NullReferenceException on entering the Play Mode when Unity Version Control tab is added to the layout
- Shortcut Helper Bar does not appear when enabling it and disabling it
- "Property (urp_ReflProbes_BoxMin) exceeds previous array size" warning spams console after switching platforms
- Have to change Input Mapping Path twice for change to take effect when Auto-Save is enabled
- No Duplicate option is available when right clicking States in the Animator Window even though it's available via Shortcut
shubhamswaraj2021
Aug 22, 2020 10:49
good one <a href="https://www.lyricsauto.com">lyricsauto</a>
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.
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
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?
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>
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.
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.
fmathews34
Jul 14, 2016 17:29
was this resolved? because i am getting the same issue in my webGL build
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.
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.