locked
Random build errors with InternalsVisibleTo RRS feed

  • General discussion

  • When compiling, I randomly get some error messages like this in the error list of visual studio:

    Error 45 'MyNamespace.MyClass' is inaccessible due to its protection level.

    and it's seems to come in pair with those errsrs :

    Error 260 Inconsistent accessibility: parameter type 'MyNamespace.MyClass' is less accessible than method ''MyNamespace2.MyClass2.SomePrivateMethod(MyNamespace.MyClass)

    The error code seem inconsistent (the same message give different error code).

    But if I retry to build when the build failed because of those errors, the second build pass. The problem always seems to occur with unit tests projects using internal classes from our main project (we use the InternalsVisibleToAttribute). I doesn't seem to be able to reproduce the bug if I don't edit code.

    We actualy have 3 classes giving those errors, but it's not really easy to say the difference they have with the others.

    Is it an already fixed bug or I need to investigate it further to have it fixed?
    Tuesday, December 22, 2009 1:56 PM

All replies

  • What about clean build? Does that always/ever reproduce this error?

    It's hard to say if it is problem in your code or in a compiler, so it is hard to say if it was already fixed. I'd suggest to assume that it is not fixed - try to create a repro and investigate. When you have a repro, try it on different machine (to confirm that it is not machine specific) and file a bug on MS Connect.

    BTW: Which compiler? C#?

    -Karel

    Tuesday, December 22, 2009 4:54 PM
    Moderator
  • Yes it's with C#.

    I'll be off for chrismas, I'll give some new this when going back from vacation.
    Tuesday, December 22, 2009 8:40 PM