【发布时间】:2016-10-19 07:44:27
【问题描述】:
我正在尝试在基于 netcoreapp1.0 构建的 aspnet5 应用程序中使用 RavenDB 我正在运行这段代码:
IDocumentStore store = new DocumentStore()
{
Url = "http://localhost:8080"
}.Initialize();
string[] databaseNames = store.DatabaseCommands.GlobalAdmin.GetDatabaseNames(1);
我的 project.json 看起来像:
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0",
"type": "platform"
},
"Microsoft.AspNetCore.Mvc": "1.0.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel.Https": "1.0.0",
"Microsoft.AspNetCore.StaticFiles": "1.0.0",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
"Microsoft.Extensions.Configuration.FileExtensions": "1.0.0",
"Microsoft.Extensions.Configuration.Json": "1.0.0",
"Microsoft.Extensions.Logging": "1.0.0",
"Microsoft.Extensions.Logging.Console": "1.0.0",
"Microsoft.Extensions.Logging.Debug": "1.0.0",
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
"Microsoft.EntityFrameworkCore": "1.0.0",
"Swashbuckle.SwaggerGen": "6.0.0-beta901",
"Swashbuckle.SwaggerUi": "6.0.0-beta901",
"RavenDB.Client": "3.5.0-rc-35173"
},
"frameworks": {
"netcoreapp1.0": {
"imports": [
"dotnet5.6",
"dnxcore50",
"netstandard1.6",
"portable-net452+win81"
]
}
}, ...
此异常失败:
Exception thrown: 'System.ArgumentNullException' in System.Private.CoreLib.ni.dll
Additional information: SafeHandle cannot be null.
这个完全相同的代码已经在 .net 45 上进行了测试并且可以工作。任何想法为什么会发生这种情况?
【问题讨论】:
-
你的代码看起来不错,在这里可以正常工作。
标签: asp.net asp.net-core ravendb