c# - Resharper with COM interop complains "Cannot access internal constructor" -


i have ocx file built using vb6 i'd access c#. added reference ocx in c# project, , added code instantiate object ocx:

    var blah = new blah(); 

this compiles fine, without errors or warnings, , seems work expect - can call methods on blah object , seem expect them do. however, if go resharper / inspect / code issues in solution, resharper complains above quoted line "c# compiler error", saying "cannot access internal constructor 'blahclass' here".

since it's claiming it's c# compiler error, yet seems compile (and in fact work) fine, i'm guessing it's issue resharper itself. however, i'm pretty new this, , i'd make sure. perhaps i'm doing not correct way of instantiating object ocx, or that?

i using vs2012 professional , resharper 7.1.3.

the c# compiler looks @ coe , sees invocation of "dynamic" code (code objects may have new methods/properties available after execution started) , can't sure particular method/property isn't there @ compile time. resharper tries out bit more trying figure out circumstances might fail @ runtime. may using out-dated description (type library) of class make decision. or, description of class out of sync code does. it's hard tell solely based on you've posted whether that's thing or bad thing. if "it works", seems thing; that's subjective--it problem waiting happen.

i see suspicious , maybe contact vendor reassurance there isn't lurking in there cause problems later.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -