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
- “Remove Unused Overrides” available on not loaded Scene and throws “ArgumentException: The scene is not loaded” warning
- Adaptive Probe Volume occlusion edge is calculated incorrectly when viewing probes near geometry edges
- Sampling a texture using an HLSL file throws shader errors and the code does not compile
- "Graphics.CopyTexture called with null source texture" error when Base Camera of an Overlay Camera is removed with DX11 Graphics API and Compatibility Mode enabled
- WebGL sends wrong value with large numbers when SendMessage function is used
Add comment