Dynamics 4.0.7 Web服务中缺少程序集

| 我已经为MS Dynamics 4.0.7添加了Web服务参考。我正在VS 2010中进行开发,但是缺少Microsoft.CRM.SDK.Messages命名空间。直到消息名称空间的所有内容都可以正常工作。 我正在研究一个使用WhoAmIRequest和WhoAmIResponse类的基本示例,但是由于缺少程序集,我无法获得更多信息。 谢谢     
已邀请:
        缺少的名称空间是SDK程序集的一部分。它不包含在网络参考中。我假设您引用的是MessageName类。 请记住,您可以使用Web引用或sdk程序集,但不能同时使用两者,因为在这种情况下,您会遇到类型冲突。     
        Web参考(crmservice)中包含WhoAmIRequest和WhoAmIResponse消息。 您可以像这样获得当前用户:
    using CrmWebReference; //whatever you called it

    ... 
//crm is the name of my CrmService object

    WhoAmIRequest userRequest = new WhoAmIRequest();
    WhoAmIResponse current = (WhoAmIResponse)crm.Execute(userRequest);
    systemuser currentUser = (systemuser)crm.Retrieve(EntityName.systemuser.ToString(), current.UserId, new AllColumns());
    

要回复问题请先登录注册