【问题标题】:Dynamics CRM 2013 SDK helper code not compilingDynamics CRM 2013 SDK 帮助程序代码未编译
【发布时间】:2013-12-03 10:50:27
【问题描述】:

Dynamics CRM 2013 SDK 附带了一些帮助程序类(不是解决方案,只是 .cs 文件),其中引用了 Microsoft.IdentityModel 和 System.IdentityModel 等内容。可以在此处 (http://msdn.microsoft.com/en-us/library/gg328228.aspx) 找到使用这些类的 CRM 2011 指南,但尚无 2013 年指南。由于两个不同的 IdentityModel 引用不明确,我无法构建 .NET 4.5 库项目。

按照 1:1 指南进行操作后,我遇到的第一个错误是找不到“SecurityToken”。新的 CRM 2013 课程有 using System.IdentityModel.Tokens 在顶部,因此我添加了对(CRM 2011 链接中未提及)System.IdentityModel 的引用。然后我得到14个这样的错误

'WSTrustChannelFactory' is an ambiguous reference between 'System.ServiceModel.Security.WSTrustChannelFactory' and 'Microsoft.IdentityModel.Protocols.WSTrust.WSTrustChannelFactory'

有没有人能够成功构建和使用 CRM 2013 的助手?我添加最后一个参考的决定是错误的吗?

【问题讨论】:

    标签: c# dynamics-crm dynamics-crm-2013


    【解决方案1】:

    我现在尝试使用 SDK 示例中的 WsdlTokenManager 类构建一个项目,我必须同时引用 Microsoft.IdentityModelSystem.IdentityModel

    在代码文件中我必须添加这两个用法:

    using WSTrustChannel = Microsoft.IdentityModel.Protocols.WSTrust.WSTrustChannel;
    using WSTrustChannelFactory = Microsoft.IdentityModel.Protocols.WSTrust.WSTrustChannelFactory;
    

    所以现在它可以编译了,但我还没有尝试运行代码来验证用户身份。

    【讨论】:

    • 是的,有同样的发现,但很高兴得到证实。谢谢。
    猜你喜欢
    • 2018-12-03
    • 2011-03-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多