如何配置NLog v4以使用VistaDB5数据库

时间:2016-10-22 03:24:26

标签: nlog vistadb

string connString = string.Format("'{0}';Pooling=False;Open Mode=NonExclusiveReadWrite;Password=Galwaypipe001", path);
DatabaseTarget dbt = new DatabaseTarget();
dbt.Name = "NLog Database";
dbt.ConnectionString = connString; // connStringBuilder.ConnectionString; // connString;
dbt.DBProvider = "VistaDB.Provider, VistaDB.5.NET40, Version=5.0.0.0, Culture=neutral";

以上结果如下:

2016-10-22 11:07:12.7492 Trace Database Target[NLog Database] has 15 layouts
2016-10-22 11:07:12.8593 Error Error initializing target 'Database Target[NLog Database]'. Exception: System.TypeLoadException: Could not load type 'VistaDB.Provider' from assembly 'VistaDB.5.NET40, Version=5.0.0.0, Culture=neutral'.
at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)
at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName)
at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
at System.Type.GetType(String typeName, Boolean throwOnError)
at NLog.Targets.DatabaseTarget.InitializeTarget()
at NLog.Targets.Target.Initialize(LoggingConfiguration configuration)

1 个答案:

答案 0 :(得分:0)

transition