.net 令人困惑的;找不到或无法访问服务器。”;错误,但仅适用于某些用户

.net 令人困惑的;找不到或无法访问服务器。”;错误,但仅适用于某些用户,.net,iis,model-view-controller,.net,Iis,Model View Controller,我正在试图找出IIS web应用程序中的一个问题。从表面上看,这似乎是一个简单的安全问题,但事实并非如此 大约一年前,我最后一次不得不对它进行修改时,它还在工作。我这次所做的更改很小,但是,当我部署到开发服务器时,我开始出现以下错误: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or wa

我正在试图找出IIS web应用程序中的一个问题。从表面上看,这似乎是一个简单的安全问题,但事实并非如此

大约一年前,我最后一次不得不对它进行修改时,它还在工作。我这次所做的更改很小,但是,当我部署到开发服务器时,我开始出现以下错误:

 A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. 
 Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
看起来很简单。显而易见的答案是去年发生了一些变化,现在找不到数据库服务器。问题是:当我尝试访问网站时,会出现错误,但其他人不会。仍然看起来像是一个简单的权限问题,除了连接字符串使用特定的用户ID和密码来访问数据库之外。参与该项目多年的企业主也无法参与其中。去年加入团队的业务分析师能够加入。我在上个月创建的一个测试用户能够进入

应用程序连接到两个独立的数据库。两个连接使用相同的用户和密码。我在服务器上安装了SSMS,我能够通过连接字符串连接到我自己和用户这两个数据库

我查看了wwwroot下应用程序文件夹中的权限,我拥有完整的权限。ApplicationPool分配了特定的用户。该用户还拥有文件夹的完全权限。我是虚拟机的管理员,但企业所有者不是,而且,另一个虚拟机管理员不能进入站点而不会出现错误

.Net Framework 4.5 MVC web应用程序部署在Win Server 2012 R2 VM上的IIS 8.5.96下

Web.Config-----------------------------------------------------

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
       <section name="system.identityModel" type="System.IdentityModel.Configuration.SystemIdentityModelSection, System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
        <section name="system.identityModel.services" type="System.IdentityModel.Services.Configuration.SystemIdentityModelServicesSection, System.IdentityModel.Services, Version=4.0.0.0,  Culture=neutral, PublicKeyToken=B77A5C561934E089" />


    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->

</configSections>

  <connectionStrings>
    <add connectionString="metadata=res://*/xxxx.csdl|res://*/xxxx.ssdl|res://*/xxx.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=xxxx;initial catalog=xxxx;User Id=xxx;Password=xxx;MultipleActiveResultSets=True;App=EntityFramework&quot;" name="Entities" providerName="System.Data.EntityClient" />
    <add connectionString="metadata=res://*/xxxx.csdl|res://*/xxxx.ssdl|res://*/xxxx.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=xxx;initial catalog=xxx;User Id=xxx;Password=xxx;MultipleActiveResultSets=True;App=EntityFramework&quot;" name="xxxxEntities" providerName="System.Data.EntityClient" />
  </connectionStrings>


  <system.web>
    <compilation targetFramework="4.5" />
    <httpRuntime targetFramework="4.5" maxRequestLength="100240" executionTimeout="1200" />
    <pages>
      <namespaces>
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Routing" />
        <add namespace="Kendo.Mvc.UI" />
      </namespaces>
    </pages>
<authorization>
        <deny users="?" />
      </authorization>
      <authentication mode="Windows" />
      <customErrors mode="Off" />   
  </system.web>

  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
      </dependentAssembly>

      <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
  <entityFramework>
    <providers>
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
    </providers>
  </entityFramework>
<system.webServer>
    <handlers>
      <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
      <remove name="OPTIONSVerbHandler" />
      <remove name="TRACEVerbHandler" />
      <remove name="WebDAV" />
      <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
    </handlers>
    <modules>
        <remove name="WebDAVModule" />
        <add name="WSFederationAuthenticationModule" type="System.IdentityModel.Services.WSFederationAuthenticationModule, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral,   PublicKeyToken=b77a5c561934e089" preCondition="managedHandler" />
        <add name="SessionAuthenticationModule" type="System.IdentityModel.Services.SessionAuthenticationModule, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral,   PublicKeyToken=b77a5c561934e089" preCondition="managedHandler" />
    </modules>

    <rewrite>
      <rules>
                <clear />
                <rule name="http to https" enabled="false" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
                        <add input="{HTTPS}" pattern="^OFF$" />
                    </conditions>
                    <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" />
                </rule>
                <rule name="Angularjs Conditions" stopProcessing="true">
                    <match url="(vendor/.*|src/.*|api/.*)" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="None" />
                </rule>
            <rule name="Imported Rule 127" enabled="true" stopProcessing="true">
                    <match url="^(.*)$" ignoreCase="true" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
                        <add input="{HTTP_HOST}" pattern="^xxx\.com$" />
                    </conditions>
                    <action type="Redirect" url="https://xxxx/{R:1}" redirectType="Permanent" />
                </rule> 
      </rules>
    </rewrite>
    <validation validateIntegratedModeConfiguration="false" />
        <httpErrors>
            <remove statusCode="403" subStatusCode="-1" />
           <error statusCode="403" prefixLanguageFilePath="" path="https://xxxx/" responseMode="Redirect" /> 
        </httpErrors>
        <security>
            <requestFiltering>
                <requestLimits maxAllowedContentLength="3000000000" />
            </requestFiltering>
        </security>
        <httpProtocol>
            <customHeaders>
            <clear />
                <add name="X-UA-Compatible" value="IE=edge" />
            </customHeaders>
        </httpProtocol>

  </system.webServer>

  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="secureBinding">
          <security mode="Transport" />
        </binding>
      </basicHttpBinding>
    </bindings>
  </system.serviceModel>

<system.identityModel>
    <identityConfiguration>
      <audienceUris>
        <add value="everyone.*" />
      </audienceUris>
      <certificateValidation certificateValidationMode="None" />
      <issuerNameRegistry type="System.IdentityModel.Tokens.ConfigurationBasedIssuerNameRegistry, System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
        <trustedIssuers>
          <add thumbprint="xxx" name="Okta" />
        </trustedIssuers>
      </issuerNameRegistry>
    </identityConfiguration>
  </system.identityModel>

  <system.identityModel.services>
    <federationConfiguration>

      <wsFederation passiveRedirectEnabled="true" issuer="xxx" realm="xxxx" />

      <cookieHandler requireSsl="false" path="/" />
    </federationConfiguration>
  </system.identityModel.services>

</configuration>


可能是某种防火墙问题?试着去激活它!请求是否出现在访问日志/http错误日志或windows事件查看器中?@Hackerman-我认为如果是防火墙问题,它会影响站点的所有用户。@MisterSmith-我没有查看访问日志。我已经查看了windows事件查看器,但没有看到任何内容。这并不意味着它不在那里。我再看一看。上周五我尝试创建了另一个.NetFr 4.5 MVC应用程序,并使用了与EntityFramework完全相同的连接字符串。一个不同之处是新网站使用的是Windows Auth,但我遇到的问题是使用Okta。还没有答案,但是,我想我现在有一些想法可以尝试。