IL2CPP构建记录
<h4>Demo U3D工程中使用的dll,调用了System.Web.dll的函数,但System.Web.dll不在U3D工程中,编译成功,运行报错</h4>
<pre><code class="language-csharp">UnloadTime: 1.524700 ms
Exception: Error: called non-existent method System.String System.Web.HttpUtility::UrlDecode(System.String)
at System.Web.HttpUtility.UrlDecode (System.String ) [0x00000] in <00000000000000000000000000000000>:0
at Test.Start () [0x00000] in <00000000000000000000000000000000>:0 </code></pre>
<h4>配置link.xml保留System.Web.dll,也不行,依然报错</h4>
<pre><code class="language-xml"><linker>
<assembly fullname="System.Web" preserve="all" />
</linker></code></pre>
<pre><code class="language-csharp">UnloadTime: 0.546700 ms
Exception: Error: called non-existent method System.String System.Web.HttpUtility::UrlDecode(System.String)
at System.Web.HttpUtility.UrlDecode (System.String ) [0x00000] in <00000000000000000000000000000000>:0
at Test.Start () [0x00000] in <00000000000000000000000000000000>:0 </code></pre>
<h3>运行报错</h3>
<pre><code class="language-csharp"> if (string.IsNullOrEmpty(applicationTag))
{
applicationTag = Path.GetFileNameWithoutExtension(Process.GetCurrentProcess().MainModule.FileName);
}</code></pre>
<pre><code class="language-csharp">ArgumentNullException: Collection cannot be null.
Parameter name: c
at System.Collections.ArrayList.InsertRange (System.Int32 index, System.Collections.ICollection c) [0x00000] in <00000000000000000000000000000000>:0
at System.Collections.ArrayList.AddRange (System.Collections.ICollection c) [0x00000] in <00000000000000000000000000000000>:0
at System.Windows.Forms.InputLanguageCollection..ctor (System.Windows.Forms.InputLanguage[] data) [0x00000] in <00000000000000000000000000000000>:0
at System.Diagnostics.Process.get_Modules () [0x00000] in <00000000000000000000000000000000>:0
at System.Diagnostics.Process.get_MainModule () [0x00000] in <00000000000000000000000000000000>:0
at VLabResource.ResCenterConfig.Refresh (System.String ndrServiceCfgPath, System.String moduleServiceCfgPath, System.String oldEquipInfoCfgPath, System.String shareCachePath, System.String resourcePath, System.String playerVersion, System.String engineVersion, System.String languageCode, VLabPlatform.ServicePlatform servicePlatform, VLabPlatform.RunTimeMode runTimeMode, System.String applicationTag) [0x00000] in <00000000000000000000000000000000>:0
at VLabResource.ResCenterConfig..ctor (System.String ndrServiceCfgPath, System.String moduleServiceCfgPath, System.String resourcePath, System.String playerVersion, System.String engineVersion, System.String languageCode, System.Boolean isNewPlatform) [0x00000] in <00000000000000000000000000000000>:0
at TDPlayer.AppStart.InitResourcePlatform (System.Boolean isNewModule, System.String resCacheDir) [0x00000] in <00000000000000000000000000000000>:0
at TDPlayer.AppStart.DelayInit () [0x00000] in <00000000000000000000000000000000>:0
at TDPlayer.AppStart+<DelayInitMonoAssetBundleManager>d__17.MoveNext () [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) [0x00000] in <00000000000000000000000000000000>:0 </code></pre>
<pre><code class="language-csharp">[MonitoringDescription("The modules that are loaded as part of this process.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Browsable(false)]
public ProcessModuleCollection Modules
{
get
{
if (modules == null)
{
SafeProcessHandle handle = null;
try
{
handle = GetProcessHandle(1024);
modules = new ProcessModuleCollection(GetModules_internal(handle));
}
finally
{
ReleaseProcessHandle(handle);
}
}
return modules;
}
}
</code></pre>