0

我正在尝试在 Windows server 2007 32 位上部署我的应用程序。我的应用程序给了我这个例外

打开 DbConnection 时出错。北 Devart.Data.Linq.LinqCommandExecutionException.CanThrowLinqCommandExecutionException (字符串消息,异常 e) 北 Devart.Data.Linq.Provider.kag() 北 Devart.Data.Linq.Provider.kab(IConnectionUser A_0) 北 Devart.Data.Linq。 Provider.kb(IConnectionUser A_0) 北 Devart.Data.Linq.Provider.DataProvider.ExecuteQuery(CompiledQuery compiledQuery, Object[] parentArgs, Object[] userArgs, Object lastResult) 北 Devart.Data.Linq.Provider.DataProvider.ExecuteAllQueries(CompiledQuery compiledQuery, Object[] userArguments) bei Devart.Data.Linq.Provider.DataProvider.CompiledQuery.Devart.Data.Linq.Provider.ICompiledQuery.Execute(IProvider provider, Object[] userArgs) bei Devart.Data.Linq.DataQuery`1 .i() 在 System.Collections.Generic.List`1..

在我的程序中执行这一行时

var list = clientCustomers.ToList();

代码

    public Repository(String Connection, String EventPackageName, String EventScopeName)
    {
        this.connectionDict = this.getConnectionInfo(Connection);

        //this.context = new DataContext(connection);//old way
        this.context = new DataContext(Connection, new Devart.Data.Oracle.Linq.Provider.OracleDataProvider());

        this.eventContext = new EventPacDataContext(Connection);
        this.eContext = new Context.EventPacDataContext(Connection, new Devart.Data.Oracle.Linq.Provider.OracleDataProvider());

        this.eventPackageName = EventPackageName;
        this.eventScopeName = EventScopeName;
        this.clientUserName = this.connectionDict["User Id"];
    }

    /// <summary>
    /// Collect all Customers from VIEW
    /// </summary>
    /// <returns>IQueryable<Customer></returns>
    public IQueryable<Customer> GetCustomers()
    {
        try
        {

            var result = from p in this.context.YDEVQUALIBASICs
                         join extended in this.context.YDEVQUALIBASICEXTENDEDs on
                         p.ACCOUNTID equals extended.ACCOUNTID
                         select
                         new Customer
                         {
                             Base = new Customer
                             {
                                 CustomerId = p.CUSTOMERID.ToString(),
                                 CustomerNo = p.CUSTOMERNO.ToString(),
                                 Geburtsdatum = p.DETGEBURTSDATUM.GetValueOrDefault(new DateTime(1900, 1, 1)),
                                 Email = p.DETEMAIL,
                                 BusinessArea = p.ACCBUSINESSAREA,
                                 ContractType = p.ACCCONTRACTTYPE,
                                 ContractTariff = p.ACCCONTRACTARIFF,
                                 SubscribeChannel = p.DETANMELDEKANAL,
                                 PaymentMethod = p.CUSCOLLECTIONIDENT,

                                 CustomerAddress = new Address
                                 {
                                     City = p.CUSCITY,
                                     Street = p.CUSSTREET,
                                     ExtendedInfo = p.CUSEHNR,
                                     StreetNumber = p.CUSHNR,
                                     LCountry = p.CUSCOUNTRYL,
                                     SCountry = p.CUSCOUNTRYS,
                                     ZipCode = p.CUSZIPCODE
                                 },

                                     AccountPerson = new Person
                                     {
                                         Salutation = p.ACCANREDE,
                                         Title = p.ACCAKADEM,
                                         Branche = p.ACCBRANCHE,
                                         Lastname = p.ACCTOMERNAME1,
                                         Firstname = p.ACCTOMERNAME2,
                                         Name3 = p.ACCTOMERNAME3
                                     }
                                 },
                                 CustomerPerson = new Person
                                 {
                                     Salutation = p.CUSANREDE,
                                     Title = p.CUSAKADEM,
                                     Branche = p.CUSBRANCHE,
                                     Lastname = p.CUSTOMERNAME1,
                                     Firstname = p.CUSTOMERNAME2,
                                     Name3 = p.CUSTOMERNAME3
                                 },

                             InternGeolocChecked = extended.DETINTERNGEOLOCCHECKED,
                             InternGeolocStatus = extended.DETINTERNGEOLOCSTATUS,
                         };

            return result;

        }
        catch (ReflectionTypeLoadException ex)
        {
            StringBuilder sb = new StringBuilder();
            foreach (Exception exSub in ex.LoaderExceptions)
            {
                sb.AppendLine(exSub.Message);
                if (exSub is FileNotFoundException)
                {
                    FileNotFoundException exFileNotFound = exSub as FileNotFoundException;
                    if (!string.IsNullOrEmpty(exFileNotFound.FusionLog))
                    {
                        sb.AppendLine("Fusion Log:");
                        sb.AppendLine(exFileNotFound.FusionLog);
                    }
                }
                sb.AppendLine();
            }
            string errorMessage = sb.ToString();
            //Display or log the error based on your application.
            logger.Fatal("Aha: " + errorMessage);
            return null;
        }

        catch (Exception ex)
        {
            logger.Fatal("Customer failed: " + ex.Message + ex.StackTrace);
            throw new DataAccessException("Customer failed", ex);
        }
    }
4

1 回答 1

0

在部署使用 LinqConnect 编写的应用程序时,您应该在 Global Assembly 注册运行时程序集 Devart.Data.Oracle.dll、Devart.Data.dll、Devart.Data.Oracle.Linq.dll 和 Devart.Data.Linq.dll缓存 (GAC) 或将它们放在应用程序的文件夹中。部署 ASP.NET 应用程序时,还需要有可用的 Devart.Data.Oracle.Web.dll 和 App_Licenses.dll 程序集。

如果所有必需的程序集都可用于您的项目,请执行以下步骤:

  1. 确保您的计算机上安装了 Oracle 客户端软件;
  2. 在 Home 连接字符串参数中明确指定 Oracle Home 的名称。
  3. 将 ORACLE_HOME 变量的内容放在操作系统的 PATH 变量的第一个位置;
  4. 确保您的应用程序的容量(x86 或 x64)与您的 Oracle 客户端的容量相同。

如果在执行这些步骤后问题仍然存在,请与我们联系以提供有关此问题的更多详细信息,例如:

  • 异常的完整堆栈跟踪;
  • 连接字符串;
  • Oracle 客户端的版本;
  • Oracle 服务器的版本;
  • 数据库表和对应实体类的定义等。
于 2013-08-09T09:22:20.130 回答