jeudi 28 janvier 2016

Could not load file or assembly 'Microsoft.Xrm.Sdk, The located assembly's manifest definition does not match the assembly reference

I am getting an issue when i call a action method on that Action Method i am getting contact details through CRM, on that time i am getting this issue " Could not load file or assembly 'Microsoft.Xrm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)"

My Action Methods: public ActionResult Contact() {

        Xrm.XrmServiceContext xrm = new XrmServiceContext(CrmService.Service);
        IQueryable<Contact> contacts = xrm.ContactSet;
        List<ContactModel> model = new List<ContactModel>();
        model.Add(new ContactModel { FirstName = "prathyu", LastName = "Reddy", Email = "p@gmail.com", Phone = "123457896" });
        model.Add(new ContactModel { FirstName = "siva", LastName = "Reddy", Email = "p@gmail.com", Phone = "123457896" });
        model.Add(new ContactModel { FirstName = "prathyusha", LastName = "Reddy", Email = "s@gmail.com", Phone = "123457896" });
        model.Add(new ContactModel { FirstName = "mallu", LastName = "dinesh", Email = "s@gmail.com", Phone = "123457896" });
        model.Add(new ContactModel { FirstName = "priya", LastName = "Reddy", Email = "acfyh@gmail.com", Phone = "123457896" });

        ViewBag.Contacts = contacts;



        return View(contacts);
    }
    public ActionResult GetContacts([DataSourceRequest]DataSourceRequest request)
    {
        Xrm.XrmServiceContext xrm = new XrmServiceContext(CrmService.Service);
        IQueryable<Contact> contacts = xrm.ContactSet;
        DataSourceResult result = contacts.ToDataSourceResult(request);
        return Json(result, "text/x-json", JsonRequestBehavior.AllowGet);
    }

Please any one clarify my dought Thanks in Advance

Aucun commentaire:

Enregistrer un commentaire