Search Issue Tracker
Third Party Issue
Votes
3
Found in [Package]
2.0.2
Issue ID
VS-26
Regression
No
Editor strips required debug information from assembly, causing debugger to fail on const variables
How to reproduce:
1. Open user-submitted project (UnityVstuReport.zip)
2. Open the SampleScene
3. Open the NewBehaviourScript in Visual Studio script editor
4. Set a breakpoint at line 14
5. In Unity, enter Play Mode
6. In Visual Studio, highlight 'm_2DArray\[k_One, k_Two]', right-click it and select 'Add to watch'
Expected result: Visual Studio displays '0' as a value
Actual result: Visual Studio displays "The identifier k_One is not in the scope"
Reproducible with: 2018.4.26f1, 2019.4.8f1, 2020.1.3f1, 2020.2.0a20(VS Editor 1.0.9, 2.0.2)
Could not test with: 2019.4.8f1, 2020.1.3f1, 2020.2.0a20(VS Editor 1.0.4)
Notes:
Changing k_One and k_Two from 'const int' to 'int' does not cause this issue
Not reproducible with Rider
Comments (2)
-
unity_130AE30C2B529E8EFB33
Jun 23, 2023 13:05
e só tbm acouteseu comigo eu n sei oq acouteseu com a unity q eu n consigo sele sona bloco editar script e tbm n cosigo personaliza augei podia ter tropesado nós fis ou algo deu errado na empresa eita unity
-
krenar_
Apr 13, 2022 14:11
still happening with Unity 2021 LTS
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
- EditorGUILayout.PropertyField foldout icon inside Vertical Layout Group has an incorrect indent when used with OnInspectorGUI()
- [Android] [iOS] "NullReferenceException: Object reference not set to an instance of an object" throws when entering the Play Mode/opening the application
- The Player freezes on load when building Web platform
- Animator "Conditions" tab breaks when the only Parameter is deleted and another one is created
- "Shader error in 'Universal Render Pipeline/Lit': maximum ps_5_0 sampler register index (16) exceeded" error thrown after a build is completed when the "LOD Cross Fade" parameter is enabled
Resolution Note:
Our apologize for the late process of this issue. The issue has been identified by Microsoft teams and is being tracked at https://developercommunity.visualstudio.com/t/const-local-variables-are-not-working-wi/10449368.
We are closing this issue. If you encounter a problem, you can report the issue directly to Microsoft through Visual Studio. Thank you.