2013-05-29 52 views
0

我跟随this tutorial使用ravenDb作为我的持久对象。RavenDb和目标机器积极拒绝

控制器上,当我试图挽救传递的值我有以下错误

> No connection could be made because the target machine actively 
> refused it 127.0.0.1:8080 

的Global.asax.cs

public class MvcApplication : System.Web.HttpApplication 
{ 
    public static IDocumentStore RavenDBDocumentStore { get; private set; } 
    private static void CreateRavenDBDocumentStore() 
    { 
     RavenDBDocumentStore = new DocumentStore 
     {  
     ConnectionStringName = "ravenDB" 
     }.Initialize(); 
    } 
    protected void Application_Start() 
    { 
     ... 
     CreateRavenDBDocumentStore(); 
    } 
} 

我已经尝试过不断变化的端口号与80818085但无论哪种方式错误信息是相同的。

这里是我的连接字符串部分

<connectionStrings>  
     <add name="DefaultConnection" 
     providerName="System.Data.SqlClient" 
     connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-RavenMvc-20121125145005;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-RavenMvc-20121125145005.mdf" /> 
     <add name="ravenDB" 
     connectionString="Url=http://localhost:8085"/> 
    </connectionStrings> 

乌鸦服务器已经启动,一切都很好之后。

+0

你关闭了Windows防火墙吗? – BlackICE

+0

@BlackICE刚试过防火墙关闭。错误是一样的:( – panjo

+0

你有任何错误在ravendb控制台窗口? – BlackICE

回答

2

您需要确保RavenDB服务器正在运行,并使用与您的应用程序相同的端口。

在连接字符串中,您指定要连接的服务器的端口,但您可能没有自己运行RavenDB服务器。

+0

感谢您的反馈,但我已经尝试过使用端口8081和8085,错误仍然 – panjo

+0

其实,它意味着相反:RavenDB没有运行在此端口上。确保在此端口上运行服务器。 –

相关问题