[英]Dynamics CRM 2013 SDK helper code not compiling
Dynamics CRM 2013 SDK附帶了一些幫助程序類(不是解決方案,只是.cs文件),其中引用了Microsoft.IdentityModel和System.IdentityModel。 可以在以下位置找到使用這些類的CRM 2011指南( http://msdn.microsoft.com/zh-cn/library/gg328228.aspx),2013年尚無指南 。 由於兩個不同的IdentityModel引用的歧義性,我無法構建.NET 4.5庫項目。
我遵循指南1:1遇到的第一個錯誤是“ SecurityToken”。 新的CRM 2013類在頂部using System.IdentityModel.Tokens
,因此我添加了對using System.IdentityModel.Tokens
的引用(在CRM 2011鏈接中未提及)。 然后我得到14個這樣的錯誤
'WSTrustChannelFactory' is an ambiguous reference between 'System.ServiceModel.Security.WSTrustChannelFactory' and 'Microsoft.IdentityModel.Protocols.WSTrust.WSTrustChannelFactory'
有誰能夠成功構建和使用CRM 2013的幫助程序? 我決定添加最后一個引用是否錯誤?
我現在嘗試從SDK示例中使用WsdlTokenManager類構建項目,並且必須同時引用Microsoft.IdentityModel
和System.IdentityModel
。
在代碼文件中,我必須添加以下兩個用法:
using WSTrustChannel = Microsoft.IdentityModel.Protocols.WSTrust.WSTrustChannel;
using WSTrustChannelFactory = Microsoft.IdentityModel.Protocols.WSTrust.WSTrustChannelFactory;
所以現在可以編譯了,但是我還沒有嘗試運行代碼來驗證用戶身份。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.