1

在我放弃这个 c# 解释器之前,我想我会检查是否有人知道这里出了什么问题。它抱怨的类型是 eloquera.client.dll。

c:\Program Files\Mono-2.10.8\bin>csharp
Mono C# Shell, type "help;" for help

Enter statements below.
csharp> LoadAssembly(@"C:\WebApp1\WebApp1\bin\webapp1.dll");
csharp> LoadAssembly(@"C:\WebApp1\WebApp1\bin\eloquera.client.dll");
csharp> using WebApp1.Models.Data_Access;
csharp> using WebApp1.Models.Persisted_classes;
csharp> using Eloquera.Client;
csharp> using System.Linq.Expressions;
csharp>
csharp> var repository = new EloqueraRepository();
csharp> var result = repository.GetAll<CustomMembershipUser>();
System.TypeLoadException: Could not load type 'Eloquera.Client.DB' from assembly
 'Eloquera.Client, Version=4.0.0.0, Culture=neutral, PublicKeyToken=170cadcdba67
be6c'.
  at Class3.Host (System.Object& $retval) [0x00000] in <filename unknown>:0
  at Mono.CSharp.Evaluator.Evaluate (System.String input, System.Object& result,
 System.Boolean& result_set) [0x00000] in <filename unknown>:0
  at Mono.CSharpShell.Evaluate (System.String input) [0x00000] in <filename unkn
own>:0
csharp>
csharp>
csharp>

编辑:专注于该问题类型:

C:\Program Files\Mono-2.11\bin>csharp
Mono C# Shell, type "help;" for help

Enter statements below.
csharp> LoadAssembly(@"C:\WebApp1\WebApp1\bin\webapp1.dll");
csharp> LoadAssembly(@"C:\WebApp1\WebApp1\bin\eloquera.client.dll");
csharp> using WebApp1.Models.Data_Access;
csharp> using WebApp1.Models.Persisted_classes;
csharp> using Eloquera.Client;
csharp> using System.Linq.Expressions;
csharp> string server = "server=localhost;password=pwd;options=none;";
csharp> Console.WriteLine(server);
server=localhost;password=pwd;options=none;
csharp> DB db = new DB(server);
(1,10): error CS0584: Internal compiler error: Unexpected error when loading typ
e `Eloquera.Client.DB'

编辑:将 Eloquera 安装升级到 EloqueraDatabase CE 4.51 .NET4.0 x32 并再次尝试。仍然无法正常工作,但结果可能更有希望:

c:\Program Files\Mono-2.10.8\bin>csharp
Mono C# Shell, type "help;" for help

Enter statements below.
csharp> LoadAssembly(@"C:\WebApp1\WebApp1\bin\webapp1.dll");
csharp> LoadAssembly(@"C:\Program Files\Eloquera\Eloquera Server 4.0\Lib\Eloquer
a.Client.dll");
csharp> using WebApp1.Models.Data_Access;
csharp> using WebApp1.Models.Persisted_classes;
csharp> using System.Linq.Expressions;
csharp> using Eloquera.Client;
csharp>
csharp>
csharp> string server = "server=localhost;password=pwd;options=none;";
csharp> Console.WriteLine(server);
server=localhost;password=pwd;options=none;
csharp> DB db = new DB(server);
csharp> db.OpenDatabase("MockDB");
Eloquera.Client.EloqueraException: The connection to the server localhost on the
 port 43962 cannot be established.

The requested feature is not implemented.
  at Eloquera.Client.DB.OpenConnection () [0x00000] in <filename unknown>:0
  at Eloquera.Client.DB.OpenDatabase (System.String dbName) [0x00000] in <filena
me unknown>:0
  at Class5.Host (System.Object& $retval) [0x00000] in <filename unknown>:0
  at Mono.CSharp.Evaluator.Evaluate (System.String input, System.Object& result,
 System.Boolean& result_set) [0x00000] in <filename unknown>:0
  at Mono.CSharpShell.Evaluate (System.String input) [0x00000] in <filename unkn
own>:0
csharp>
4

2 回答 2

0

试试 LoadAssembly(@"C:\WebApp1\WebApp1\bin\Eloquera.Client.dll"); 或匹配与命名空间相同的大小写。

于 2013-03-27T05:53:02.797 回答
0

我过去在 Mono 2.10.x 中看到过一些 TypeLoadException 问题。

我建议升级到 Mono 2.11.3 或更高版本。

于 2012-07-30T21:17:10.380 回答