ASP.Net Web 应用程序部署到 IIS 错误身份验证无效



我在本地机器上用 ASP.net MVC构建了一个Web应用程序。它运行正常,没有问题。

现在,当我将其发布到 Web 部署包中,然后在 IIS 服务器上运行安装程序时,它会正确安装。然后,当我浏览到该网站时,登录页面允许我登录和所有内容。但是一旦我尝试访问需要我的SQL连接的页面。我收到此错误。而且我一直无法弄清楚。

Server Error in '/SPBCyberSecurity' Application.
Keyword not supported: 'authentication'. 
  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
 Exception Details: System.ArgumentException: Keyword not supported: 'authentication'.
Source Error: 

[ArgumentException: Keyword not supported: 'authentication'.]
   System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey) +6667870
   System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useOdbcRules) +134
   System.Data.SqlClient.SqlConnectionString..ctor(String connectionString) +103
   System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous) +35
   System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(DbConnectionPoolKey key, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions) +294
   System.Data.SqlClient.SqlConnection.ConnectionString_Set(DbConnectionPoolKey key) +60
   System.Data.SqlClient.SqlConnection.set_ConnectionString(String value) +89
   System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch(TTarget target, Action`2 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed) +207
   System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.SetConnectionString(DbConnection connection, DbConnectionPropertyInterceptionContext`1 interceptionContext) +438
   System.Data.Entity.Core.EntityClient.EntityConnection.ChangeConnectionString(String newConnectionString) +900
[EntityException: The underlying provider failed on ConnectionString.]
   System.Data.Entity.Core.EntityClient.EntityConnection.ChangeConnectionString(String newConnectionString) +1305
   System.Data.Entity.Internal.LazyInternalConnection.InitializeFromConnectionStringSetting(ConnectionStringSettings appConfigConnection) +161
   System.Data.Entity.Internal.LazyInternalConnection.TryInitializeFromAppConfig(String name, AppConfig config) +46
   System.Data.Entity.Internal.LazyInternalConnection.Initialize() +95
   System.Data.Entity.Internal.LazyInternalConnection.CreateObjectContextFromConnectionModel() +16
   System.Data.Entity.Internal.LazyInternalContext.InitializeContext() +340
   System.Data.Entity.Internal.LazyInternalContext.get_ObjectContext() +21
   System.Data.Entity.Internal.InternalContext.ExecuteSqlQuery(String sql, Nullable`1 streaming, Object[] parameters) +124
   System.Data.Entity.Internal.InternalContext.ExecuteSqlQueryAsIEnumerator(String sql, Nullable`1 streaming, Object[] parameters) +92
   System.Data.Entity.Internal.InternalContext.ExecuteSqlQuery(Type elementType, String sql, Nullable`1 streaming, Object[] parameters) +255
   System.Data.Entity.Internal.InternalSqlNonSetQuery.GetEnumerator() +44
   System.Data.Entity.Infrastructure.DbRawSqlQuery`1.GetEnumerator() +48
   System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +446
   System.Linq.Enumerable.ToList(IEnumerable`1 source) +80
   CyberSecurity.Controllers.OverviewClass.getVulnOverview(String theDate) +347
   CyberSecurity.Controllers.HomeController.Dashboard() +102
   lambda_method(Closure , ControllerBase , Object[] ) +79
   System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +242
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +39
   System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) +12
   System.Web.Mvc.Async.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult) +139
   System.Web.Mvc.Async.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d() +112
   System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +452
   System.Web.Mvc.Async.<>c__DisplayClass33.<BeginInvokeActionMethodWithFilters>b__32(IAsyncResult asyncResult) +15
   System.Web.Mvc.Async.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() +37
   System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +241
   System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +29
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +111
   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +53
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +19
   System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +51
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +111
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +606
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +288

发布到 Web 配置包生成的连接字符串

<setParameter name="VulnDBEntities-Web.config Connection String" value="metadata=res://*/VulnsModel.csdl|res://*/VulnsModel.ssdl|res://*/VulnsModel.msl;provider=System.Data.SqlClient;provider connection string='Data Source=devsrv47;Initial Catalog=VulnDB;Persist Security Info=True;User ID=***********;Password=****************;Authentication=&quot;Active Directory Password&quot;'" />

根据你发布的内容,你似乎在连接字符串中使用了"身份验证"一词,这不受支持。

最新更新