Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sql-server-2005/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net mvc 4 为什么具有Windows身份验证的实体框架不将我的凭据传递给SQL Server?_Asp.net Mvc 4_Sql Server 2005_Entity Framework 5_Iis 6_Windows Authentication - Fatal编程技术网

Asp.net mvc 4 为什么具有Windows身份验证的实体框架不将我的凭据传递给SQL Server?

Asp.net mvc 4 为什么具有Windows身份验证的实体框架不将我的凭据传递给SQL Server?,asp.net-mvc-4,sql-server-2005,entity-framework-5,iis-6,windows-authentication,Asp.net Mvc 4,Sql Server 2005,Entity Framework 5,Iis 6,Windows Authentication,我正在尝试使用Entity Framework 5在运行IIS6的web服务器上运行MVC 4 intranet站点,但Windows身份验证/集成安全性无法正常工作,因为错误显示 堆栈跟踪: [SqlException(0x80131904):用户登录失败 “EASTDOMAIN\WEBDEV2$”。] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException 异常,布尔断开连接)+5104926 System.Data.

我正在尝试使用Entity Framework 5在运行IIS6的web服务器上运行MVC 4 intranet站点,但Windows身份验证/集成安全性无法正常工作,因为错误显示

堆栈跟踪:

[SqlException(0x80131904):用户登录失败 “EASTDOMAIN\WEBDEV2$”。]
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException 异常,布尔断开连接)+5104926
System.Data.SqlClient.TdsParser.throweexception和warning()+260
System.Data.SqlClient.TdsParser.Run(RunBehavior, SqlCommand cmdHandler、SqlDataReader数据流、, BulkCopySimpleResultSet bulkCopyHandler,TdsParserStateObject stateObj)+2294
System.Data.SqlClient.sqlinternalconnectionds.CompleteLogin(布尔值 正常)+35
System.Data.SqlClient.sqlinternalconnectionds.AttemptOneLogin(ServerInfo serverInfo、字符串newPassword、布尔值IgnoresInOpenTimeout、, TimeoutTimer超时,SqlConnection owningObject,布尔值 带故障切换)+250
System.Data.SqlClient.sqlinternalconnectionds.loginnofilover(ServerInfo serverInfo、字符串newPassword、布尔重定向EducserInstance、, SqlConnection owningObject、SqlConnectionString connectionOptions、, TimeoutTimer timeout)+932
System.Data.SqlClient.sqlinternalconnectionds.OpenLoginEnlist(SqlConnection owningObject、TimeoutTimer、SqlConnectionString 连接选项、字符串newPassword、布尔重定向edUserInstance) +195 System.Data.SqlClient.SqlInternalConnectionDS..ctor(DbConnectionPoolIdentity 标识、SqlConnectionString连接选项、对象提供程序信息、, 字符串newPassword,SqlConnection owningObject,布尔值 重定向导出实例)+316
System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions 选项、对象池组ProviderInfo、数据库连接池池、, DbConnection owningConnection)+185
System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection、DbConnectionPool池、DbConnectionOptions选项) +33 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection 拥有对象)+524
System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection 拥有对象)+66
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection 拥有对象)+479
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection 拥有连接)+108
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection 外部连接,DbConnectionFactory连接工厂)+126
System.Data.SqlClient.SqlConnection.Open()+125
System.Data.SqlClient.SqlProviderServices.UsingConnection(SqlConnection sqlConnection,动作
1动作)+85
System.Data.SqlClient.SqlProviderServices.UsingMasterConnection(SqlConnection sqlConnection,Action
1 act)+341
System.Data.SqlClient.SqlProviderServices.GetDbProviderManifestToken(DbConnection 连接)+258
System.Data.Common.DbProviderServices.GetProviderManifestToken(DbConnection 连接)+34

[ProviderIncompatibleException:提供程序未返回 ProviderManifestToken字符串。]
System.Data.Common.DbProviderServices.GetProviderManifestToken(DbConnection 连接)+163
System.Data.Entity.ModelConfiguration.Utilities.DbProviderServicesExtensions.GetProviderManifestTokenChecked(DbProviderServices providerServices,数据库连接)+41

[ProviderIncompatibleException:获取时出错 数据库中的提供程序信息。这可能是由实体 框架使用了不正确的连接字符串。请检查内部 有关详细信息的异常,请确保连接字符串 正确。]
System.Data.Entity.ModelConfiguration.Utilities.DbProviderServicesExtensions.GetProviderManifestTokenChecked(DbProviderServices providerServices,数据库连接)+166
System.Data.Entity.ModelConfiguration.Utilities.DbConnectionExtensions.GetProviderInfo(DbConnection 连接,DbProviderManifest和providerManifest)+40
System.Data.Entity.DbModelBuilder.Build(DbConnection 提供商连接)+46
System.Data.Entity.Internal.LazyInternalContext.CreateModel(LazyInternalContext 内部上下文)+62
System.Data.Entity.Internal.RetryLazy
2.GetValue(TInput输入)+117
System.Data.Entity.Internal.LazyInternalContext.InitializeContext() +453 System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(类型 entityType)+18
System.Data.Entity.Internal.Linq.InternalSet
1.Initialize()+56
System.Data.Entity.Internal.Linq.InternalSet
1.Include(字符串路径)
+18 System.Data.Entity.Infrastructure.DbQuery
1.Include(字符串路径)+73 System.Data.Entity.DbExtensions.Include(IQueryable
1
源,字符串路径)+85
System.Data.Entity.DbExtensions.Include(IQueryable
1源代码, 表达式
1路径)+126
重合闸控制器重合闸控制器索引()+198
lambda_方法(闭包、控制器库、对象[])+62
System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase 控制器,对象[]参数)+17
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext,IDictionary
2个参数)+188
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext,ActionDescriptor ActionDescriptor,IDictionary
2
参数)+27
System.Web.Mvc.Async.c__DisplayClass42.b__41() +28 System.Web.Mvc.Async.c_uuudisplayClass8
1.b_uu7(IAsyncResult )+12 System.Web.Mvc.Async.WrappedAsyncResult
1.End()+50 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult
异步结果)+29
System.Web.Mvc.Async.c\u显示
<?xml version="1.0" encoding="utf-8"?>
<!--
    For more information on how to configure your ASP.NET application, please visit
    http://go.microsoft.com/fwlink/?LinkId=169433
    -->
<configuration>
    <configSections>
        <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
        <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
    </configSections>
    <connectionStrings>
             <add name="ReclosingContext" connectionString="Data Source=sqlserverbox\devtest;Initial Catalog=Reclosing;Integrated Security=SSPI;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />

    </connectionStrings>
    <appSettings>
        <add key="webpages:Version" value="2.0.0.0" />
        <add key="webpages:Enabled" value="false" />
        <add key="PreserveLoginUrl" value="true" />
        <add key="ClientValidationEnabled" value="true" />
        <add key="UnobtrusiveJavaScriptEnabled" value="true" />
    </appSettings>
    <system.web>
        <compilation targetFramework="4.0" />
        <authentication mode="Windows" />
        <authorization>
            <deny users="?" />
        </authorization>
        <pages>
            <namespaces>
                <add namespace="System.Web.Helpers" />
                <add namespace="System.Web.Mvc" />
                <add namespace="System.Web.Mvc.Ajax" />
                <add namespace="System.Web.Mvc.Html" />
                <add namespace="System.Web.Optimization" />
                <add namespace="System.Web.Routing" />
                <add namespace="System.Web.WebPages" />
            </namespaces>
        </pages>
    </system.web>
    <system.webServer>
        <validation validateIntegratedModeConfiguration="false" />
        <modules runAllManagedModulesForAllRequests="true" />
    <handlers>
            <remove name="cshtml-ISAPI-4.0_64bit" />
            <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
            <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
            <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
            <add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
            <add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
            <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
                        <add name="cshtml-ISAPI-4.0_64bit" path="*.cshtml, *." verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
        </handlers>
                <defaultDocument>
                        <files>
                                <add value="index.aspx" />
                        </files>
                </defaultDocument></system.webServer>
    <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <dependentAssembly>
                <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
                <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
                <bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
                <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
                <bindingRedirect oldVersion="1.0.0.0-1.3.0.0" newVersion="1.3.0.0" />
            </dependentAssembly>
        </assemblyBinding>
    </runtime>
    <entityFramework>
        <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
    </entityFramework>
        <location path="Web.config">
                <system.web>
                        <compilation defaultLanguage="c#" />
                </system.web>
        </location>
</configuration>
<add name="ReclosingContext" connectionString="Data Source=sqlserverbox\devtest;Initial Catalog=Reclosing;Integrated Security=False;User ID=xxxxxxxx;Password=xxxxxxxxx;MultipleActiveResultSets=True"
      providerName="System.Data.SqlClient" />