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
- Assigned font's bold/font-weight styles render using Default Font's assets when Default Font has corresponding style assets defined in TMP Settings
- "Modifying the parent of a VisualElement while it’s already being modified is not allowed" error is thrown when entering text and pressing tab in the Search window
- Mesh colliders are not updating their positions of bounds correctly
- Images are missing from the "Open the sprite editor" documentation for 6.0, 6.1 and 6.2
- The previous element in the array is modified when assigning an Asset to a new element of AssetReferenceT
Add comment