2016-10-04 68 views
0

我有一个ASP.net webforms项目,通过Business Connector文件版本(5.0.1500.4570)连接到axapta 2009。一切顺利,直到突然我开始有这个错误登录到axapta时出错'Microsoft.Dynamics.BusinessConnectorNet.LogonFailedException'

'Microsoft.Dynamics.BusinessConnectorNet.LogonFailedException' occurred in ******.dataaccess.dll but was not handled in user code 

     at b2b.logosoft.com.tr.dataaccess.AxaptaConnectorHelper.AxaptaObject() in d:\Projects\B2B\b2b.logosoft.com.tr.site\b2b.logosoft.com.tr.dataaccess\AxaptaConnectorHelper.cs:line 29 
    at b2b.logosoft.com.tr.dataaccess.CurrencyDataAccess.GetCurrency(String fromcurrency, String tocurrency) in d:\Projects\B2B\b2b.logosoft.com.tr.site\b2b.logosoft.com.tr.dataaccess\CurrencyDataAccess.cs:line 14 
    at b2b.logosoft.com.tr.businessmanager.CurrencyService.GetCurrencyRate(String fromcurrency, String tocurrency) in d:\Projects\B2B\b2b.logosoft.com.tr.site\b2b.logosoft.com.tr.businessmanager\CurrencyService.cs:line 17 
    at b2b.logosoft.com.tr.businessmanager.CurrencyService.GetRates() in d:\Projects\B2B\b2b.logosoft.com.tr.site\b2b.logosoft.com.tr.businessmanager\CurrencyService.cs:line 80 
    at b2b.logosoft.com.tr.site.UserControls.Header.Page_Load(Object sender, EventArgs e) in d:\Projects\B2B\b2b.logosoft.com.tr.site\b2b.logosoft.com.tr.site\UserControls\header.ascx.cs:line 34 
    at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) 

输出为:

'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-1-131200350151628806): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_32\System.Transactions\v4.0_4.0.0.0__b77a5c561934e089\System.Transactions.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 
'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-1-131200350151628806): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Numerics\v4.0_4.0.0.0__b77a5c561934e089\System.Numerics.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 
'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-1-131200350151628806): Loaded 'C:\Windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.8387_none_5094ca96bcb6b2bb\msvcm90.dll'. Cannot find or open the PDB file. 
'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.8387_none_5094ca96bcb6b2bb\msvcm90.dll'. Cannot find or open the PDB file. 
'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Windows\assembly\GAC_32\Microsoft.Dynamics.BusinessConnectorNet\5.0.0.0__31bf3856ad364e35\Microsoft.Dynamics.BusinessConnectorNet.dll'. Cannot find or open the PDB file. 
A first chance exception of type 'Microsoft.Dynamics.BusinessConnectorNet.LogonFailedException' occurred in Microsoft.Dynamics.BusinessConnectorNet.dll 
A first chance exception of type 'Microsoft.Dynamics.BusinessConnectorNet.LogonFailedException' occurred in b2b.logosoft.com.tr.dataaccess.dll 
A first chance exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll 
A first chance exception of type 'Microsoft.Dynamics.BusinessConnectorNet.LogonFailedException' occurred in Microsoft.Dynamics.BusinessConnectorNet.dll 
A first chance exception of type 'Microsoft.Dynamics.BusinessConnectorNet.LogonFailedException' occurred in b2b.logosoft.com.tr.dataaccess.dll 
'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-1-131200350151628806): Loaded 'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.Debugger.Runtime\12.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Debugger.Runtime.dll'. 
'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-1-131200350151628806): Loaded 'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.DebuggerVisualizers\12.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.DebuggerVisualizers.dll'. Cannot find or open the PDB file. 

这里是连接器的辅助类:

public class AxaptaConnectorHelper 
{ 
    #region Class Properties 
    public static Axapta Ax { get; set; } 
    public static string UserName { get { return AxaptaConnectionInfo.AxUserName; } } 
    public static string Password { get { return AxaptaConnectionInfo.AxPassword; } } 
    public static string Domain { get { return AxaptaConnectionInfo.AxDomain; } } 
    public static string Company { get { return AxaptaConnectionInfo.AxCompany; } } 
    public static string Aos { get { return AxaptaConnectionInfo.AxAos; } } 
    #endregion 
    public Axapta AxaptaObject() 
    { 
     try 
     { 
      var nc = new NetworkCredential(UserName, Password, Domain); 
      Ax = new Axapta(); 
      Ax.LogonAs(UserName, Domain, nc, Company, "", Aos, ""); 
     } 
     catch (Exception ex) 
     { 
      Ax = null; 
      throw ex; 
     } 
     return Ax; 
    } 
} 

我曾尝试如下:

  1. 清洁解决方案和重建
  2. 的业务接口卸下参考,然后重建
  3. 添加的业务接口的基准对所有在我的解决方案
  4. 改变了构建属性目标平台的x86为这些项目所有的项目
  5. 清理临时文件夹中的项目

似乎没有任何解决的问题。

回答

1

A LogonFailedException只是表示您的objAX.Logon()objAX.LogonAs()失败。这通常与构建或临时文件夹没有任何关系,但是您的代码实际上无法使用主机名/端口/配置或用户名连接到AOS。

您不显示实际的代码调用登录/ logonas,但您的代码或者找不到AOS或不能使用您提供的用户名/密码或您的服务/执行帐户登录到它。

确保服务正在运行,您可以连接到它(即无防火墙),并且用户未被禁用或锁定在Active Directory中,并且仍然是AX中的用户。

试想想起来了,AOS(可能是群集的一部分)可以拒绝连接known as draining

+0

我可以使用Axapta的桌面应用程序连接到Axapta的。这意味着我没有被阻止,管理员审查了我的axapta登录凭据,这一切都很好。 – iceDragon

+0

@iceDragon如何发布一些代码呢? –

+0

我已经添加了。错误发生在'Ax.LogonAs' – iceDragon