question

onesoul-9574 avatar image
0 Votes"
onesoul-9574 asked onesoul-9574 edited

Visual Studio 2019 16.10 Find All References Error

After I updated from 16.9 to 16.10, there was an error in finding all references,

C # in case (int) someenum.none:, find the reference of none in switch () case, the reference number of finding "case (int) someenum.none" will be displayed, with the reference times of 0

In 16.9, it is normal, and all references of someenum.none will be displayed normally

This is repeated as follows

public enum SomeEnum

{

None,

}

public void TestSwitch()

{

var a = (int)SomeEnum.None; // one

swicth(1)

{

case (int)SomeEnum.N one:break; // two

}

}

At this time, if you right-click none in line 1 to find all references, you will find two, 1 and 2.

However, if you right-click none in 2 to find all references, you will find them with the whole tag case (int) someenum. None, and the reference is 0

This is not the case in 16.9


我从16.9更新到16.10以后,查找所有引用出错,
c#中,如果在switch() case中 case (int)SomeEnum.None:, 查找None的引用,就会显示查找“ case (int)SomeEnum.None”这整个标签的引用,引用次数就是0
而在16.9时,就是正常的,会正常显示SomeEnum.None的所有引用
复现如下
public enum SomeEnum
{
None,
}

public void TestSwitch()
{
var a = (int)SomeEnum.None; //1
swicth(1)
{
case (int)SomeEnum.None:break; //2
}
}
这个时候,如果在1行中右键None查找所有引用,就会找到两个,1,2这两个。
但是如果在2中右键None查找所有引用,就会以 case (int)SomeEnum.None 这整个标签查找,引用为0
这个情况在16.9中没有

dotnet-csharpvs-general
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @onesoul-9574 , currently in Microsoft Q&A we only support English, could you please edit your question into English?

0 Votes 0 ·

ok, thank you

0 Votes 0 ·

1 Answer

TianyuSun-MSFT avatar image
1 Vote"
TianyuSun-MSFT answered

Hi @onesoul-9574 ,

Welcome to Microsoft Q&A forum.

I tested with VS 2019 previous version and VS 2019 16.10.1, and I can reproduce this issue. In 16.10.1 version, the case (int)SomeEnum.None: was identified as a label, so Find All References feature search for the reference to case (int)SomeEnum.None:.

This change may be from the improvement of Intellisense feature of Visual Studio 2019, but after I checked the related options, release notes, I didn’t find any possible option to disable this feature.

I have started a new thread on our Developer Community and reported this issue to Visual Studio Product Team, here is the link. Please kindly follow that thread and wait for VS Product Team’s reply.

Thanks for helping us make VS better.

Best Regards,
Tianyu


If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.