intellisense can't figure out a 'internal' accessibility level syntax error of in visual studio & C#

zhyy2008z

when i call a function that comes from an other assembly and its accessibility level is 'internal', the intellisense should figure out a syntax error, such as "XXX is inaccessible due to its protection level". but it doesn't. without doubt, compilation failed.

however, after i change the function's accessibility level to an other level, such as 'private', it figures out the syntax error.

what makes 'internal' so different, and why? or it just a bug in visual studio?

sample code:

static void Main(string[] args)
{
    var t= new AssemblyBCode();
    t.test();
}

code in the other assembly (referenced solution):

public class AssemblyBCode
{
    internal void test() { }
}
quetzalcoatl

Of course, internals idea is to hide the things from other assemblies while providing access to things fro 'original' assembly, but there's an assembly attribute called InternalsVisibleToAttribute with use of which you can explicitely instruct the framework that AssemblyA shall have access to internals of AssemblyB.

Of course*) for the IDE/compiler it should be perfectly clear*) if your current assembly has or has not access. It may be some petty bug or some problem with signing keys.. it's hard to say without seeing it by myself, unfortunatelly I dont have vs2012..

EDIT: *) see HansPassant comment: the problems is that it's NOT clear until after the assembly is signed at the end of the build job, which, probably, has not been properly finished yet.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Can't figure out what the Syntax error is

From Dev

Can't figure out what this syntax error is

From Dev

MySQL Syntax Error, Can't Figure it Out

From Dev

Syntax error that I can't figure out

From Dev

I can't figure out why there is a syntax error in this code

From Dev

MySQL syntax error, can't figure out what's wrong

From Dev

Syntax error I can't figure out? python3

From Dev

I can't figure out C++ syntax error "expected `;' before ‘{’ token"

From Dev

Visual Studio 2010 reference errors I can't figure out

From Dev

python syntax error can figure out!! variable

From Dev

Can't figure out if/else syntax in Python

From Dev

Can't figure out if/else syntax in Python

From Dev

Error c3867 in c++ Can't figure it out

From Dev

An error in simple C++, but can't figure out why

From Dev

Can't figure out why syntax error near "from" is appearing for sqldf in R

From Dev

Can't figure out "Syntax error near unexpected token `done'" issue

From Java

Can't figure out this Error in Eclipse Java

From Dev

Rspec error, can't figure it out

From Dev

Can't figure out error with ActionListener

From Dev

JSP servlett error, can't figure it out

From Dev

can't figure out my validation error

From Dev

Can't figure out this android error

From Dev

Can't figure out the following error

From Dev

Can't figure out what the error is referring to

From Dev

Can't figure out error with ActionListener

From Dev

Can't figure out this type error

From Dev

mySQL Fatal Error - Can't Figure It Out

From Dev

Can't figure out this JSON parsing error

From Dev

Getting parse / syntax error and can not figure out why