Search Issue Tracker
By Design
Votes
0
Found in
2017.3.0f3
Issue ID
985754
Regression
No
"Does not contain a definition" error for texture.imageContentsHash when building
To reproduce:
1. Open attached Unity project "Unity201703BUG.zip"
2. Inspect "TestTexture" script in the Assets folder
3. Build and run the project
4. Inspect console
Result: "Type 'UnityEngine.Texture' does not contain a definition for 'imageContentsHash' and no extension method..." error, even though there was no compilation error and testing in play mode shows hash value of the texture correctly displayed in the console.
Note: "TestTexture" is not even used in the scene
Note: prior to 2017.3.0b4 the same error would not let you enter play mode, now it only affects build.
Reproduced on: 5.6.5f1, 2017.1.2p4, 2017.2.1p1, 2017.3.0p1, 2018.1.0b1
Comments (1)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- "Shader warning in 'Hidden/Light2D': implicit truncation of vector type" is thrown when building Universal 2D template
- AI Assistant breaks compilation of packages using System.Runtime.CompilerServices.Unsafe via auto-referencing
- Unity Hub checks the "Documentation" module by default on the 6.4 and 6.5 streams despite that it was unchecked with the previous installs
- Shortcut that toggles between Dopesheet and Curves Views in the Animation Window's Timeline is mislabed
- Property List Items Overlap onto the Property List's top edge when scrolling through a long Property List
EddieOffermann
Apr 01, 2020 18:37
Issue was resolved and marked "By Design" but there should be additional explanation here:
Texture.imageContentsHash is only meant to work in the Editor because the "consumer" of that parameter is the Editor, not user code (at least not primarily). The documentation isn't very clear on this - it only mentions that it's Editor-only at the end of a paragraph in the middle of the documentation for the parameter. That should really be called out in the short description of the parameter that appears on any page for children of the Texture class.