我一直在尝试使用Blueprint.NET,它应该是Tinkerpop的C#实现,以访问OrientDB.我一直在搜索网站并通过电子邮件向开发人员发送电子邮件,但无论如何都无法找到它们.我已经使用了一些REST代码来连接到OrientDB,但它似乎并没有每个人都应该说的速度.我想尝试Blueprint.NET来看看它是否会更快.任何帮助,将不胜感激.
我一直在用F#创建自托管应用服务器.我已经启动并运行了应用服务器,我可以使用C#客户端进行连接,但是使用F#可以更好地完成我想做的一些事情.问题是我似乎无法使F#客户端正常工作.我找到了一些例子,但我似乎无法让它们中的任何一个起作用.最有希望的是这里.在这个例子后,我想出了以下代码:
let address= new EndpointAddress("net.tcp://192.168.101.100:2009/PrevisionService/tcp")
let factory = new ChannelFactory<IPrevisionAppServer>("NetTcpBinding_IPrevisionAppServer", address)
let channel = factory.CreateChannel()//address)
let GetDataObject (sql) = channel.GetDataObject(sql)
factory.Close()
Run Code Online (Sandbox Code Playgroud)
但是我收到以下错误:
找不到名为"NetTcpBinding_IPrevisionAppServer"的端点元素,并在ServiceModel客户端配置部分中收缩"PrevisionAppServer.Main + IPrevisionAppServer".这可能是因为没有为您的应用程序找到配置文件,或者因为在客户端元素中找不到与此名称匹配的端点元素.
我有一个app.config文件,它在C#中工作得很好:
<?xml version="1.0" encoding="utf-8"?>
<!--Client Config-->
<configuration>
<system.serviceModel>
<bindings>
<netTcpBinding>
<binding name="NetTcpBinding_IPrevisionAppServer" closeTimeout="00:01:00"
openTimeout="00:20:00" receiveTimeout="01:00:00" sendTimeout="01:00:00"
hostNameComparisonMode="StrongWildcard"
maxBufferSize="2147483647"
maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647"
maxStringContentLength="2147483647"
maxArrayLength="2147483647"
maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
</binding>
</netTcpBinding>
</bindings>
<client>
<endpoint address="net.tcp://192.168.101.100:2009/PrevisionService/tcp" behaviorConfiguration="ServiceViewEventBehavior"
binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IPrevisionAppServer"
contract="*" name="NetTcpBinding_IPrevisionAppServer">
</endpoint>
</client>
<behaviors>
<endpointBehaviors>
<behavior name="ServiceViewEventBehavior">
<dataContractSerializer maxItemsInObjectGraph="2147483647"/>
</behavior>
</endpointBehaviors>
</behaviors>
</system.serviceModel>
</configuration>`
Run Code Online (Sandbox Code Playgroud)
无论出于何种原因,它似乎忽略了app.config文件.有任何想法吗?是否有更好的代码来实现这一点?任何人将不胜感激!
更新 …
我正在做一个简单的插入流星集合,看起来很有效,但是将集合留空了.
该集合在服务器上正确定义:
Meteor.publish("comments", function () {
return Comments.find();
});
Run Code Online (Sandbox Code Playgroud)
在client.js中正确订阅:
Meteor.subscribe("commments");
Run Code Online (Sandbox Code Playgroud)
并在model.js上正确设置:
Comments = new Meteor.Collection("comments");
Run Code Online (Sandbox Code Playgroud)
插入代码如下:
Meteor.methods({
addComment: function (options) {
check(options.post_id, String);
check(options.comment, NonEmptyString);
if (! this.userId)
throw new Meteor.Error(403, "You must be logged in to comment.");
if (options.comment.length > 1000)
throw new Meteor.Error(413, "Comment is too long");
var post = Posts.findOne(options.post_id);
if (! post)
throw new Meteor.Error(404, "No such post");
// add new comment
var timestamp = (new Date()).getTime();
console.log('Comment: ' + options.comment);
console.log('Post: ' + options.post_id); …Run Code Online (Sandbox Code Playgroud) 我正在使用VS 2010并致力于将我们的应用程序升级到.NET 4.该应用程序是以Excel为基础构建的,我们希望利用.NET的一些改进来使用Excel.但是我遇到了一个奇怪的错误,这个错误似乎是在通用字典中使用Excel Interop对象引起的.这是生成的错误:
C:\MyApp\TheAssembly\MyClass.cs(823,57):
error CS1769: Type 'MyApp\OtherAssemply.IMyController.SheetReports' from assembly 'c:\MyApp\OtherAssemply.\bin\Debug\OtherAssembly.dll'
cannot be used across assembly boundaries because it has a generic type
parameter that is an embedded interop type.
Run Code Online (Sandbox Code Playgroud)
这是有问题的实际属性:
Dictionary<Excel.Worksheet, IReportSheet> SheetReports { get;}
Run Code Online (Sandbox Code Playgroud)
我们无法在通用对象中使用Interop对象吗?如果是这样,这是.NET 4.0中的严重限制.我尝试将Embed Interop属性设置为false,但这似乎没有改变任何东西.如果有任何解决方法,请告诉我.