简体   繁体   中英

C# Visual Studio opens with source codes when I click on a class with ctrl +

While working on C# with Visual Studio, when I hover (CTRL + mouse click) on a class from the system libraries, the class opens with its all source codes. In the past, when I did the same action, only the public elements of that class were displayed.

I want to display only the elements that I have access to instead of displaying all the code in the classes that I am not authorized to edit. What can I do? I am using Visual Studio 2022.

https://i.stack.imgur.com/pFqnI.png

From your question, you are using (CTRL + mouse click) to open the source code to display all the source code, you should probably select Enable Navigation to Decompiled Source Code in the settings, you can cancel this option.

It is possible to change the source code that cannot be defined for a member to display its metadata. Can view declarations of types and members, but not implementations

To do this: Select "Tools" > "Options" from the menu bar. Then, expand Text Editor > C# > Advanced and uncheck "Enable Navigation to Decompiled Source" 在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM