Visual Studio 2019 - external routines sayiing "It may be inaccessable"

Iain Hayward 21 Reputation points
2021-02-12T10:23:58.173+00:00

Hi,

I am working on some legacy code and have been noticing problems with VS2019. Today I am getting the error messages on all external call to a local DLL. The message is saying "xxxx routine is not declared. It may be inaccessible due to it's protection level". However, the module runs in debug without error....But all the calls are highlighted with a red line underneath... Any thoughts what's going on? The language is VB.

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,261 questions
VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,755 questions
0 comments No comments
{count} votes

Accepted answer
  1. Karen Payne MVP 35,461 Reputation points
    2021-02-12T11:34:37.38+00:00

    I've seen this when targeting .NET 5 and not with lower .NET Frameworks. A telltale sign that the IDE is incorrect is as with you I can replicate this and still run and actually go to the definition of any line as per below.

    Example

    Here is where the other images comes from, select menu item project then show all files.
    67404-4444444.png

    67428-11111111111.png

    Then here is a incorrect assessment by Visual Studio

    67403-222222.png

    Note

    I've not reported this as I have a experimental setup within Visual Studio. If this truly bothers you then report it to Microsoft via the feedback/report an issue button.

    67447-3333333333333.png

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.