在我放弃这个 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>