0

Dynamics CRM 2013 SDK 附带一些帮助程序类(不是解决方案,只是 .cs 文件),它们引用 Microsoft.IdentityModel 和 System.IdentityModel 等内容。使用这些类的 CRM 2011 指南可以在这里找到 ( http://msdn.microsoft.com/en-us/library/gg328228.aspx),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 的助手?我添加最后一个参考的决定是错误的吗?

4

1 回答 1

0

I tried to build a project with the WsdlTokenManager class from the SDK samples now and I had to reference both Microsoft.IdentityModel and System.IdentityModel.

In the code file I had to add these two usings:

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

So now it compiles, but I have not tried running the code to authenticate a user.

于 2013-12-05T11:49:19.080 回答