c# - The modifier 'new' is not valid for this item -


i created class groupprincipalextension : groupprincipal can see inherits system.directoryservices.accountmanagement.groupprincipal

now when try create constructor in extension class,

public new groupprincipalextension() {     //do } 

i error,

the modifier 'new' not valid item

based on read, can add own constructors derived class or without 'new' keyword

edit

if remove new keyword:

'system.directoryservices.accountmanagement.groupprincipal' not contain constructor takes 0 arguments

remove new constructor , should work. declare new keyword when you're creating instance.

also since inherits class might want declare this:

public groupprincipalextension()     : base() // parameters ?? {     //do } 

Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -