在CRM2011 SDK示例代码SystemUser类 [英] SystemUser class in CRM2011 SDK Sample Code

查看:156
本文介绍了在CRM2011 SDK示例代码SystemUser类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在用的是微软CRM2011示例代码,当我尝试使用Visual Studio 2010来编译它,(我只用了C-夏普代码,没有VB请为我),我得到这个错误:




错误13类型或命名空间名称'SystemUser无法找到
(是否缺少using指令或程序集引用?)systemuserprovider。 CS




我编译的文件,直接从SDK

  ... 
SystemUser的currentUser = serviceProxy.Retrieve(SystemUser.EntityLogicalName,currentUserId,新ColumnSet(域名))ToEntity< SystemUser>();
...

类似的问题与
...



//查询检索其他用户。
QueryExpression querySystemUser =新QueryExpression
{
实体名称= SystemUser.EntityLogicalName,
ColumnSet =新ColumnSet(新的String [] {systemuserid,全名}),
标准=新FilterExpression()
};



...



我的是包括

 使用系统; 
:使用System.IO;
使用System.Text;
使用System.Collections.Generic;使用的System.DirectoryServices
; / *您需要使用System.Linq的System.DirectoryServices.dll程序* /
;
使用System.Xml.Linq的;
使用的System.Web;
使用System.Web.UI程序;使用System.Web.UI.WebControls
;
使用System.ServiceModel;
使用System.ServiceModel.Description;

使用Microsoft.Xrm.Sdk;
使用Microsoft.Xrm.Sdk.Query;
使用Microsoft.Xrm.Sdk.Client;使用Microsoft.Xrm.Sdk.Messages
;

使用Microsoft.Crm.Sdk;使用Microsoft.Crm.Sdk.Messages
;
...



有谁知道在哪里可以找到SystemUser的定义吗?



迈克


解决方案

早期绑定类必须从CRM中产生,其中包括在项目



有在SDK中的实用程序来做到这一点:sdk\bin\CrmSvcUtil.exe



打开命令提示符,然后移动到bin文件夹结果
运行带有这些参数的程序:



<预类=郎-CMD prettyprint -override> CrmSvcUtil.exe /用户名:kingjulian /密码:julianisking /url:https://julian.madagascar.com/XRMServices/2011/Organization.svc /out:jCRM.cs / serviceContextName:语境




  • 的用户名和密码是自我解释

  • URL是组织服务URL是要生成

  • 出CS文件

  • serviceContextName是类的名称,你可以实例化和编写LINQ查询打击。



在jCRM.cs已添加到项目中,您将有机会获得SystemUser类。< BR>文件jCRM.cs位于sdk\bin。


I am using the Microsoft CRM2011 Sample Code, when I try to compile it with Visual Studio 2010, (i use the C-Sharp code only, No VB for me please), i get this error:

Error 13 The type or namespace name 'SystemUser' could not be found (are you missing a using directive or an assembly reference?) systemuserprovider.cs

I am compiling a file straight from the SDK

...
SystemUser currentUser = serviceProxy.Retrieve(SystemUser.EntityLogicalName, currentUserId, new ColumnSet("domainname")).ToEntity<SystemUser>();
...

Similar issue with ...

// Query to retrieve other users. QueryExpression querySystemUser = new QueryExpression { EntityName = SystemUser.EntityLogicalName, ColumnSet = new ColumnSet(new String[] { "systemuserid", "fullname" }), Criteria = new FilterExpression() };

...

My includes are:

using System;
using System.IO;
using System.Text;
using System.Collections.Generic;
using System.DirectoryServices;      /* you need System.DirectoryServices.dll */
using System.Linq;
using System.Xml.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ServiceModel;
using System.ServiceModel.Description;

using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Query;
using Microsoft.Xrm.Sdk.Client;
using Microsoft.Xrm.Sdk.Messages;

using Microsoft.Crm.Sdk;
using Microsoft.Crm.Sdk.Messages;
...

Does anyone know where I can find a definition of SystemUser ?

Mike

解决方案

The early bound classes must be generated from CRM and included in the project.

There is a utility in the SDK to do this: sdk\bin\CrmSvcUtil.exe

Open a command prompt and move to the bin folder.
Run the program with these parameters:

CrmSvcUtil.exe /username:kingjulian /password:julianisking /url:https://julian.madagascar.com/XRMServices/2011/Organization.svc /out:jCRM.cs /serviceContextName:Context

  • Username and password are self explanatory
  • url is the organization service url
  • out is the cs file to be generated
  • serviceContextName is the name of the class that you can instantiate and write Linq queries against.

Once jCRM.cs has been added to the project you will have access to the SystemUser class.
The file jCRM.cs is located in sdk\bin.

这篇关于在CRM2011 SDK示例代码SystemUser类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆