none
The type or namespace MongoServer could not be found RRS feed

  • Question

  • Referencing this Azure Tutorial, "Create a web app in Azure that connects to MongoDB running on a virtual machine" [sorry, not allowed to post link], released three months ago and already apparently out of date.

    I followed the instructions, copied the code but am unable to build the application with this error: CS0246 the type or namespace MongoServer could not be found Dal.cs line 13.

    Azure support responds "If a type or namespace is not available, it’s generally because of a missing assembly or DLL.". Agreed, but there is no missing assembly or dll. I suspect the API has changed but can find no documentation in support of this suspicion. I am therefore unable to resolve the issue.

    I originally suspected the MongoDb.driver API had changed. The example uses version 2.0.1 and I had installed the latest, 2.2.4. However, after uninstalling the latest version and installing version 2.0.1 I get three errors, the original plus two others. I'm left wondering, how was this code originally built?

    Thursday, June 9, 2016 4:15 PM

Answers

  • Hi mayapur.tv,

    As the document of MongoServer Class said, this class is in MongoDB.Driver.Legacy dll. So you need to add MongoDB Legacy API.

    Best Regards,
    Li Wang


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, June 10, 2016 2:16 AM
    Moderator

All replies

  • Hi mayapur.tv,

    As the document of MongoServer Class said, this class is in MongoDB.Driver.Legacy dll. So you need to add MongoDB Legacy API.

    Best Regards,
    Li Wang


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, June 10, 2016 2:16 AM
    Moderator
  • Indeed, that was the solution. Thank you.
    Friday, June 10, 2016 7:54 PM
  • Hi mayapur.tv,

    Thank you for your feedback. If your problem has been resolved, please close this thread by mark helpful replies as answer.

    Best Regards,
    Li Wang


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Saturday, June 11, 2016 9:04 AM
    Moderator