发行:
我正在使用Microsoft Dynamics CRM 2011。我增加了一个扩展(客户服务联系人)到我们的客户关系管理。
我还需要对UI做一些相应的更改。为此,我从 XRM.cs的再生开始了我的更改。
作为其中的一部分,我做了以下工作:
C:\Users\<userName>\SDK\Bin>CrmSvcUtil.exe
/codeCustomization:"Microsoft.Xrm.Client.CodeGeneration.CodeCustomization,
Microsoft.Xrm.Client.CodeGeneration" /out:\Xrm003.cs
/url:http://<url_for_server>/<organization_name>/XRMServices/2011/Organization.svc
/domain:"<domain_name>" /username:"<username>" /password:"<password>"
/namespace:<desired_namespace_name> /serviceContextName:XrmServiceContext这帮助我再生了Xrm003.cs。但是,当我将这个新生成的Xrm003.cs与已经存在的Xrm003.cs进行比较时,我可以看到实体中有一些我根本没有触及的不同之处。
以下是其中一些:
原来的一本有:
/// <summary>
/// Drop-down list for selecting the category of the account.
/// </summary>
[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("accountcategorycode")]
public Microsoft.Xrm.Sdk.OptionSetValue AccountCategoryCode
{
get
{
return this.GetAttributeValue<Microsoft.Xrm.Sdk.OptionSetValue>("accountcategorycode");
}
set
{
this.OnPropertyChanging("AccountCategoryCode");
this.SetAttributeValue("accountcategorycode", value);
this.OnPropertyChanged("AccountCategoryCode");
}
}新的有:
/// <summary>
/// Drop-down list for selecting the category of the account.
/// </summary>
[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("accountcategorycode")]
public System.Nullable<int> AccountCategoryCode
{
get
{
return this.GetAttributeValue<System.Nullable<int>>("accountcategorycode");
}
set
{
this.SetAttributeValue<Microsoft.Xrm.Sdk.OptionSetValue>("AccountCategoryCode", "accountcategorycode", value);
}
}如果您注意到这些差异,您将看到两件事:
AccountCategoryCode的类型是Microsoft.Xrm.Sdk.OptionSetValue (在原始),System.Nullable<int>在再生。set的实现方式。这对许多其他实体也是如此。
谁能让我知道为什么这是因为或者我错过了XRM.cs再生的任何一步?提前感谢!
编辑:一件事,可能是什么原因(?)在这两个XRM.cs之间,我们已经将汇总16应用于客户关系管理。
解决问题的解决方案:
请参考达里尔的回答,我已将其标记为答案。
我按照他的话对我的XRM.cs再生命令做了如下更改(下面是适当的命令,它帮助我解决了问题):
C:\Users\<userName>\SDK\Bin>CrmSvcUtil.exe
/out:\Xrm003.cs
/url:http://<url_for_server>/<organization_name>/XRMServices/2011/Organization.svc
/domain:"<domain_name>" /username:"<username>" /password:"<password>"
/namespace:<desired_namespace_name> /serviceContextName:XrmServiceContext结论:
我的命令中有我在我的问题中提到的引起问题的下列情况:
/codeCustomization:"Microsoft.Xrm.Client.CodeGeneration.CodeCustomization,
Microsoft.Xrm.Client.CodeGeneration"我的问题仅仅是通过删除它就解决了。
发布于 2014-09-23 19:49:21
不管"Microsoft.Xrm.Client.CodeGeneration.CodeCustomization,Microsoft.Xrm.Client.CodeGeneration"是什么,都有一些定制的代码生成。我猜这就是改变了。它看起来几乎已经更改为在Windows中运行,因为它是不支持属性更改事件。
你试过EarlyBound发生器吗
https://stackoverflow.com/questions/25999878
复制相似问题