小编Tom*_*ood的帖子

从FSharp.Compiler.Service嵌入F#Interactive Example Throwing Exception

我正在研究来自http://fsharp.github.io/FSharp.Compiler.Service/interactive.html的Embedding F#Interactive示例,但是出现以下行引发异常的问题:

let fsiSession = FsiEvaluationSession.Create(fsiConfig, allArgs, inStream, outStream, errStream)
Run Code Online (Sandbox Code Playgroud)

抛出的异常是:

"FSharp.Compiler.Service.dll中发生了'System.Exception'类型的未处理异常附加信息:创建评估会话时出错:StopProcessing null"

我的项目是从VS2015 Enterprise Update 1运行的,设置为一个简单的F#控制台应用程序,目标F#运行时为F#4.0,目标框架为4.6.从nuget下载的FSharp.Compiler.Service版本是2.0.0.2.

我正在运行的Program.Fs文件代码在这里(示例的直接端口):

open System
open System.IO
open System.Text
open Microsoft.FSharp.Compiler.SourceCodeServices
open Microsoft.FSharp.Compiler.Interactive.Shell

[<EntryPoint>]
let main argv =

    let sbOut = new StringBuilder()
    let sbErr = new StringBuilder()
    let inStream = new StringReader("")
    let outStream = new StringWriter(sbOut)
    let errStream = new StringWriter(sbErr)

    // Build command line arguments & start FSI session
    let argv = [| "C:\\fsi.exe" |]
    let allArgs = Array.append argv …
Run Code Online (Sandbox Code Playgroud)

f# f#-interactive

6
推荐指数
1
解决办法
276
查看次数

在Cassandra中设置节点间加密

我是Cassandra的新手,希望在Cassandra 1.2.8中设置节点加密.

我已按照此处列出的步骤成功为密钥库和信任库创建了密钥对:http: //docs.oracle.com/javase/6/docs/technotes/guides/security/jsse/JSSERefGuide.html#CreateKeystore

在Cassandra.yaml文件中,我已将服务器加密选项调整为以下内容:

server_encryption_options:
    internode_encryption: all
    keystore: conf/keystore
    keystore_password: password
    truststore: conf/truststore
    truststore_password: password
Run Code Online (Sandbox Code Playgroud)

但是,当我启动Cassandra服务器时,我收到以下错误:

ERROR 18:49:20,883 Fatal configuration error
org.apache.cassandra.exceptions.ConfigurationException: Unable to create ssl socket
        at org.apache.cassandra.net.MessagingService.getServerSocket(MessagingService.java:410)
        at org.apache.cassandra.net.MessagingService.listen(MessagingService.java:390)
        at org.apache.cassandra.service.StorageService.joinTokenRing(StorageService.java:589)
        at org.apache.cassandra.service.StorageService.initServer(StorageService.java:554)
        at org.apache.cassandra.service.StorageService.initServer(StorageService.java:451)
        at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:348)
        at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:447)
        at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:490)
Caused by: java.io.IOException: Error creating the initializing the SSL Context
        at org.apache.cassandra.security.SSLFactory.createSSLContext(SSLFactory.java:124)
        at org.apache.cassandra.security.SSLFactory.getServerSocket(SSLFactory.java:53)
        at org.apache.cassandra.net.MessagingService.getServerSocket(MessagingService.java:406)
        ... 7 more
Caused by: java.io.FileNotFoundException: conf\truststore\dev (The system cannot find the path specified)
        at java.io.FileInputStream.open(Native Method)
        at …
Run Code Online (Sandbox Code Playgroud)

cassandra

3
推荐指数
1
解决办法
2191
查看次数

列出使用 Mono.Cecil 调用方法的所有引用

我正在开发一个项目来清理遗留代码,并且需要以编程方式查找调用 .​​NET 4.5 服务引用(即 Reference.cs 文件)中某些 SOAP Web 方法的所有引用,以便我可以输出到文本文件或 Excel(基本上,引用如 CodeLens 功能所列)。我想我会使用Mono.Cecil库来完成这项任务。

我有指定程序集和类的方法,效果很好,因为我可以打印要查看的所有方法的列表。但是关于如何获取特定方法的参考列表有什么想法吗?

// assemblyName is the file path for the specific dll   
public static void GetReferencesList(string assemblyName)
    {
        AssemblyDefinition assembly = AssemblyDefinition.ReadAssembly(assemblyName);

        foreach (ModuleDefinition module in assembly.Modules)
        {
            foreach (TypeDefinition type in module.Types)
            {
                if (type.Name.ToLowerInvariant() == "classname")
                {
                    foreach (MethodDefinition method in type.Methods)
                    {
                        if (method.Name.Substring(0, 4) != "get_" &&
                            method.Name.Substring(0, 4) != "set_" &&
                            method.Name != ".ctor" &&
                            method.Name != ".cctor" &&
                            !method.Name.Contains("Async"))
                        {
                            //Method …
Run Code Online (Sandbox Code Playgroud)

.net c# reflection mono

3
推荐指数
1
解决办法
2529
查看次数

标签 统计

.net ×1

c# ×1

cassandra ×1

f# ×1

f#-interactive ×1

mono ×1

reflection ×1