Forum Discussion
john john
Sep 24, 2020Iron Contributor
'AuthenticationManager' does not contain a constructor that takes 0 arguments
I have the following code to connect to SharePoint using clientID and ClientSecret:- string siteUrl = "https://****l.sharepoint.com/sites/DocumentApprovalProcess/";
string clientId = "**...
evanchatter37
Apr 05, 2022Copper Contributor
When you provided a constructor for your class that takes arguments, the compiler no longer creates an empty constructor. Therefore, you cannot call an empty constructor because it does not exist. You would need to explicitly write the constructor that takes 0 arguments in your class's code. The constructor of the http://net-informations.com/faq/oops/inheritancetype.htm class needs to construct the base class first. since the base class does not have a default constructor (taking 0 arguments) and you are not using the non-default constructor you have now, this won't work. so either:
- Add a default constructor to your base class, in which case the code of the descending class needs no change;
Or
- Call the non-default constructor of the base class from the constructor of the descending class, in which case the base class needs no change.