Hi guys, i got this error:
The error here
DllNotFoundException: Unable to load DLL ‘kernel32.dll’: The specified module could not be found.
at Microsoft.Win32.UnsafeNativeMethods.GetModuleHandle (System.String moduleName) [0x00000] in <00000000000000000000000000000000>:0
at Microsoft.Win32.UnsafeNativeMethods.DoesWin32MethodExist (System.String moduleName, System.String methodName) [0x00000] in <00000000000000000000000000000000>:0
at Microsoft.Win32.UnsafeNativeMethods._IsPackagedProcess () [0x00000] in <00000000000000000000000000000000>:0
at System.Func1[TResult].Invoke () [0x00000] in <00000000000000000000000000000000>:0 at System.Lazy1[T].CreateValue () [0x00000] in <00000000000000000000000000000000>:0
at System.Lazy1[T].LazyInitValue () [0x00000] in <00000000000000000000000000000000>:0 at System.Lazy1[T].get_Value () [0x00000] in <00000000000000000000000000000000>:0
at System.Xml.Serialization.TempAssembly.LoadGeneratedAssembly (System.Type type, System.String defaultNamespace, System.Xml.Serialization.XmlSerializerImplementation& contract) [0x00000] in <00000000000000000000000000000000>:0
at System.Xml.Serialization.XmlSerializer…ctor (System.Type type, System.String defaultNamespace) [0x00000] in <00000000000000000000000000000000>:0
at System.Xml.Serialization.XmlSerializer…ctor (System.Type type) [0x00000] in <00000000000000000000000000000000>:0
at LocalizationManager.Awakee () [0x00000] in <00000000000000000000000000000000>:0
at LocalizationManager.Awake () [0x00000] in <00000000000000000000000000000000>:0
when using this namespace
System.Xml.Serialization.XmlSerializer
and building with IL2CPP and .NET 4.6
So is XmlSerializer not supported when building with .NET 4.6?
It’s a known issue - we are looking into potential fixes. It’s tracked by case 887128.
But yeah, unfortunately it does not work today.
Oh I see. Gladly i found a XML parser that doesn’t require XmlSerializer. Here is the link if someone need an alternative to XmlSerializer.
Hey guys, I’m still having this issue in 2018.2.4f1. Is there a specific version I need to be on for the fix?
The workaround today is to switch to .NET Standard 2.0 (NOT .NET 2.0) profile. The fix for .NET 4.6 profile is coming to Unity 2018.3.
Hey, still running into this with 2018.3.b6 when using .NET 4.6 profile. The linked issue tracker item shows the issue as been resolved, but it has only been fixed for the .NET Standard 2.0 set.
Is there a fix for .NET 4.6 planned for 2018.3?
This should be working on .NET 4.6 profile in 2018.3. Let me follow up on it.
In the meantime, what scripting runtime version is set in the editor to on your project?
We’re having the following configuration:
- Scripting Backend: IL2CPP
- Scripting Runtime: .NET 4.x Equivalent
- API level: .NET 4.x
We’re building for Microsoft HoloLens with it, using the newest Release of the MRTK. We also use a lot of other thirdparty libraries like RestSharp.Portable, Newtonsoft.Json, Serilog etc - essentially the whole backend of a complex business application.
We found that we’re able to compile with .NET Standard 2.0 as well, so besides some smaller things we had to take out we have a workaround available. However having it solved for .NET 4.6 as well would be better to have.
We’re using 2018.3.0b6 right now, but will update to the newest beta version of Unity soon.
I can confirm the fix for .NET 4.6 profile landed to 2018.3.0b8 which is about to be released.
I’m still getting this same error in 2019.3. How is this possible so many years later…
Are you sure you’re facing the same issue? It was fixed a year ago.
Hello.
Receive same warning on Android
2020.04.29 13:35:23.481 26607 26641 Warn Unity : Plugins: Couldn’t open kernel32, error: dlopen failed library “kernel32” not found
2020.04.29 13:35:23.481 26607 26641 Warn Unity Microsoft.Win32.<>c:<.cctor>b__9_0()
2020.04.29 13:35:23.481 26607 26641 Warn Unity System.Lazy1:CreateValue() 2020.04.29 13:35:23.481 26607 26641 Warn Unity System.Lazy1:LazyInitValue()
2020.04.29 13:35:23.481 26607 26641 Warn Unity System.Lazy`1:get_Value()
2020.04.29 13:35:23.481 26607 26641 Warn Unity System.Xml.Serialization.TempAssembly:LoadGeneratedAssembly(Type, String, XmlSerializerImplementation&)
2020.04.29 13:35:23.481 26607 26641 Warn Unity System.Xml.Serialization.XmlSerializer:.ctor(Type, String)
2020.04.29 13:35:23.481 26607 26641 Warn Unity System.Xml.Serialization.XmlSerializer:.ctor(Type)
The warning occurs sometimes and generally does not interfere with the operation, since XML serialization continues to work.