Incorrect VB code analysis

I have a VB Desktop (Windows Forms) application. One of the Form classes defines a private methode which R# marks as not used.

But the method is called in the constructor of  the class, which is located in the separate .designer file.

(Don't think about, why it is coded this way. It is a very old VB6 application which was converted to .NET some years ago...)

I have deleted the R# Cache with no success.

Regards

Andreas

5 comments

Hello Andreas!

 

As the specified method is private and is located in different module not sure it can be accessed from designer file.

You can see that ReSharper cannot resolve this method on the screenshot you've provided.

You can try disabling ReSharper and checking if VS could resolve the method in this case. If it's just ReSharper behavior I'd suggest to share the solution demonstrating the issue so we could reproduce the problem.

Thank you.

0

When i change the method to Protected, R# recognize that it is used. I tried to reproduce the case in a small solution, but i couldn't.

I must say, that it is a very special case, because the application was originally implemented in VB6 and then ported to .NET. The code was added by the migration assistant.

Best Regards

Andreas

0

Hello Andreas!

 

Thank you for the reply.

Have you tried disabling ReSharper? How does VS behave in this case?

Thank you.

0

if i disable R#, VS behaves as expected and doesn't mark the method as not used.

Best Regards

Andreas

0

Thank you for the reply, Andreas.

 

Is there any chance you could share the solution? You can do it privately via 'Submit a request' form and we can sign NDA if needed.

Thank you.

0

Please sign in to leave a comment.