Search Issue Tracker
By Design
Votes
0
Found in
5.5.1p4
Issue ID
914047
Regression
No
FileNotFoundException exception when there are special characters in the assembly path when calling Activator.CreateInstance
How to reproduce:
1. Open attached project
2. Attempt to enter play mode
3. Notice error in the console
Reproduced on: 5.5.0f1, 5.5.3p4, 5.6.1f1, 2017.1.0b6, 2017.2.0a1
Some Lithuanian characters that reproduce the issue: ą č ę ė į š ų ū
Other non-standard characters work too
Workaround:
Activator.CreateInstanceFrom(this.appDomain, proxyType.Assembly.CodeBase, proxyType.FullName); ->
Activator.CreateInstanceFrom(this.appDomain, proxyType.Assembly.Location, proxyType.FullName);
Activator.CreateInstanceFrom is passed a file name from proxyType.Assembly.CodeBase. This string is a URI, which is the local file name, prefixed with "file:///". This prefix indicates that Mono should treat the file name as a URI. It needs to escape any characters that in the string then. The result of this process leaves the 'é' in the path incorrectly modified. Then the assembly won't load, and the reported error occurs.
Instead of proxyType.Assembly.CodeBase, if proxyType.Assembly.Location is used, the script works as expected. The assembly is properly loaded. The Location property of assembly does not prefix the path with "file:///", so Mono does not attempt to escape characters in the URI. It treats the path as a local file path, which is properly found then.
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- “[Worker0] Could not generate preview image“ error when opening macOS native plugin in the Inspector with Architecture to build for set to ARM 64-bit
- [iOS] Application.absoluteURL is empty on Awake/Start when opening via deep link with Splash Screen disabled
- Crash on MemoryManager::Deallocate when rapidly calling Addressables.LoadAssetAsync
- Crash on physx::shdfnd::atomicIncrement when adjusting values on a character controller component after entering Play mode in Prefab edit mode
- [Rendering Debugger] [NewInputSystem] Debug Overlays in Play mode throws InvalidOperationException when using New Input System
Add comment