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
- Opening Terrain Prefab in Prefab Editing Mode throws "NullReferenceException" error
- [Search] Dragging query pills put them behind the search text field
- A CustomPropertyDrawer that returns a PropertyField for a property named the same as a child field will not render all child fields
- Graphics Settings shows default values instead of the real values in the Rendering Debugger when Volume.profile is assigned via script
- Deleting multiple Tags throws “NullReferenceException”, and "Retrieving array element that was out of bounds" errors when holding the Enter key
Add comment