locked
'Add' and no extension method 'Add' accepting a first argument of type 'example.Data.ExamStage.Staff' RRS feed

  • Question

  • Hi,

    I am new to .NET, C# when I run my ETL with C# code project, getting the following error:


    'example.Data.ExamStage.Staff' does not contain a definition for 'Add' and no extension method 'Add' accepting a first argument of type 'example.Data.ExamStage.Staff' could be found (are you missing a using directive or an assembly reference?) C:\example\ContactInfo\ContactInfoDataLoader.cs


    Please do the needful.

    Thanks in advance,

    Krish

    • Moved by Rob Va - MSFT Tuesday, August 28, 2012 6:34 PM (From:FAST Products (pre-2010))
    Monday, July 30, 2012 11:45 AM

All replies

  • Hi Krish,

    As this forum is for Fast specific issues, I will be moving this to a forum dealing with .NET/C# questions.

    Thanks!

    Rob Vazzana | Sr Support Escalation Engineer | US Customer Service & Support

    Customer Service   & Support                            Microsoft| Services

    Tuesday, August 28, 2012 6:32 PM
  • Hi Krish,

    Welcome to the MSDN Forum.

    Based on my understanding, it seems that you need to redesign your class "example.Data.ExamStage.Staff", add one more method "Add".

    Best regards,


    Ghost,
    Call me ghost for short, Thanks
    To get the better answer, it should be a better question.

    Wednesday, August 29, 2012 7:36 AM
  • Show us the code for 'Add' and how u r calling it.

    Please mark this post as answer if it solved your problem. Happy Programming!

    Monday, September 3, 2012 2:58 AM
  • Error is that C# compiler can not resolve method or extension method Add that takes example.Data.ExamStage.Staff as an parameter so you are probably missing one, are not referencing required assembly or have not resolved the correct namespace.

    If you are using newest Visual Studio then by hovering over the Add that is not found, click context menu open and look for Resolve. This should resolve problem if you are just missing the using statement of the namespace. If there is no resolve option, then error is somewhere else.

    Other option is that you need to add reference to assembly that contains class that has correct Add method you can look under the References section if there is any invalid reference, usually those are reference that can not be resolved what might occur if for example you have copied project or moved the referenced assembly. 

    Last option is that you need to implement the correct method, but surely you should know if that's the case.


    • Edited by MasaSam Tuesday, September 11, 2012 12:49 PM
    Tuesday, September 11, 2012 12:48 PM