【问题标题】:InvalidOperationException: Unknown connection string parameter 'SSLMode'InvalidOperationException:未知的连接字符串参数“SSLMode”
【发布时间】:2021-08-04 14:52:57
【问题描述】:

我刚刚进入了一个 Asp.NET 网络项目,我正在尝试设置应用程序。当我运行应用程序并在 localhost 上调用端点时,我收到错误“InvalidOperationException: Unknown connection string parameter 'SSLMode'”。

这是完整的堆栈跟踪:

[InvalidOperationException: Unknown connection string parameter 'SSLMode'.]
   Devart.Common.DbConnectionOptions.ParseConnectionString(Hashtable synonyms) +1761
   Devart.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useFirstKeyValuePair) +232
   Devart.Data.PostgreSql.f..ctor(String A_0) +70
   Devart.Data.PostgreSql.w.a(String A_0, DbConnectionOptions A_1) +38
   Devart.Common.DbConnectionFactory.a(String A_0, DbConnectionOptions& A_1, DbConnectionBase A_2) +128
   Devart.Common.DbConnectionBase.set_ConnectionString(String value) +97
   System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch(TTarget target, Action`2 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed) +98
   System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.SetConnectionString(DbConnection connection, DbConnectionPropertyInterceptionContext`1 interceptionContext) +514
   System.Data.Entity.Internal.LazyInternalConnection.TryInitializeFromAppConfig(String name, AppConfig config) +39
   System.Data.Entity.Internal.LazyInternalConnection.Initialize() +161
   System.Data.Entity.Internal.LazyInternalConnection.get_ProviderName() +16
   System.Data.Entity.Internal.DefaultModelCacheKeyFactory.Create(DbContext context) +135
   System.Data.Entity.Internal.LazyInternalContext.InitializeContext() +772
   System.Data.Entity.Internal.InternalContext.Initialize() +26
   System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) +20
   System.Data.Entity.Internal.Linq.InternalSet`1.Initialize() +69
   System.Data.Entity.Internal.Linq.InternalSet`1.GetAsyncEnumerator() +21
   System.Data.Entity.Infrastructure.IDbAsyncEnumerableExtensions.ForEachAsync(IDbAsyncEnumerable`1 source, Action`1 action, CancellationToken cancellationToken) +69
   System.Data.Entity.Infrastructure.IDbAsyncEnumerableExtensions.ToListAsync(IDbAsyncEnumerable`1 source, CancellationToken cancellationToken) +315
   System.Data.Entity.Infrastructure.IDbAsyncEnumerableExtensions.ToListAsync(IDbAsyncEnumerable`1 source) +55
   SDS1.Business.Repositories.<GetAllApplicationsByRoleAsync>d__6.MoveNext() in ...\Repositories\ApplicationRepository.cs:75
   System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +32
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +62
   System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() +32
   MagWien.SDS1Web.Controllers.<Index>d__6.MoveNext() in ...\Controllers\HomeController.cs:39
   System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +32
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +62
   System.Web.Mvc.Async.TaskAsyncActionDescriptor.EndExecute(IAsyncResult asyncResult) +92
   System.Web.Mvc.Async.<>c__DisplayClass8_0.<BeginInvokeAsynchronousActionMethod>b__1(IAsyncResult asyncResult) +22
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +42
   System.Web.Mvc.Async.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__11_0() +72
   System.Web.Mvc.Async.<>c__DisplayClass11_1.<InvokeActionMethodFilterAsynchronouslyRecursive>b__2() +396
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +42
   System.Web.Mvc.Async.<>c__DisplayClass3_6.<BeginInvokeAction>b__3() +50
   System.Web.Mvc.Async.<>c__DisplayClass3_1.<BeginInvokeAction>b__5(IAsyncResult asyncResult) +188
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +38
   System.Web.Mvc.<>c.<BeginExecuteCore>b__152_1(IAsyncResult asyncResult, ExecuteCoreState innerState) +29
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +73
   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +52
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +39
   System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +38
   System.Web.Mvc.<>c.<BeginProcessRequest>b__20_1(IAsyncResult asyncResult, ProcessRequestState innerState) +43
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +73
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +38
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +651
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +220
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +134

该项目使用 postgres 数据库和 dotConnect。该应用程序在其他同事的机器上运行得很好,但在我的机器上却不行:我们基本上使用的是相同类型的虚拟机。因此,我真的不想更改代码中的任何内容以使应用程序运行。我的机器上安装了 dotConnect。如果有人有类似的问题,我会很感激任何建议。谢谢!

【问题讨论】:

  • PostgreSQL 的连接字符串是否已准备就绪,或者您正在对其进行更改?例外是清除说它不是连接字符串的属性。 devart.com/dotconnect/postgresql/docs/…
  • 但实际上是这样。问题是,即使我有许可证信息,我的机器上也没有安装 devart... 正在关闭

标签: asp.net asp.net-mvc postgresql entity-framework dotconnect


【解决方案1】:

问题是,即使我有许可证信息,我的机器上也没有安装 devart...正在关闭

【讨论】:

    猜你喜欢
    • 2020-08-25
    • 2016-04-11
    • 2015-10-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-05-02
    • 2020-04-29
    • 1970-01-01
    相关资源
    最近更新 更多