C# Web.Config中允许所有用户,但应用程序仍提示输入用户名/密码?

C# Web.Config中允许所有用户,但应用程序仍提示输入用户名/密码?,c#,asp.net,asp.net-mvc,oracle,iis-7,C#,Asp.net,Asp.net Mvc,Oracle,Iis 7,因此,我有一个ASP.NET MVC5应用程序,我使用Oracle&Entity Framework开发。最初,我使用LocalDB上下文文件进行开发,在清除了大多数bug之后,我建立了与实际ORACLE DB表的连接,并修改了应用程序中所需的内容,以允许使用LocalDB上下文文件实现相同的功能 在我的本地机器上一切正常,但当我发布到接收到的服务器时 在中找不到连接名称“OraasNetConsting” 应用程序配置或连接字符串为空 我尝试了以下几种解决方案: <connectionS

因此,我有一个ASP.NET MVC5应用程序,我使用Oracle&Entity Framework开发。最初,我使用LocalDB上下文文件进行开发,在清除了大多数bug之后,我建立了与实际ORACLE DB表的连接,并修改了应用程序中所需的内容,以允许使用LocalDB上下文文件实现相同的功能

在我的本地机器上一切正常,但当我发布到接收到的服务器时

在中找不到连接名称“OraasNetConsting” 应用程序配置或连接字符串为空

我尝试了以下几种解决方案:

<connectionStrings>
      <clear />
      <add name="OraAspNetConString" connectionString="RandomConnection" />
      <-- My Other Connection Strings -->
</connectionStrings>
<system.web>
    <authentication mode="Windows" />
      <authorization>
          <allow users="*"/>
          <deny users="?"/>
      </authorization>
    <system.web>
        <authentication mode="Windows" />
          <authorization>
              <allow users="*"/>
              <deny users="?"/>
          </authorization>
          <membership>
              <providers>
                  <remove name="OracleMemberShipProvider" />
              </providers>
          </membership>
          <roleManager>
              <providers>
                  <remove name="OracleRoleProvider" />
              </providers>
          </roleManager>

更新

以上是我在尝试导航到服务器计算机上项目的发布位置时收到的信息。尝试在本地浏览器上访问时,我收到:

Runtime Error

Server Error in '/' Application. Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine. 

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".

有什么想法吗?我知道同一服务器上的其他应用程序使用的是
Oracle.DataAccess.Client
,工作正常,而对于我的框架版本,我必须使用
Oracle.ManagedDataAccess

Windows身份验证始终提示输入凭据,即使访问的是每个人都可以访问的目录。“除了切换到非Windows身份验证和针对AD进行身份验证之外,我不知道有什么办法可以解决这个问题。”@mason,我认为AD对我在这里所做的工作有用。您能否提供一个示例,说明我需要修改哪些内容以使用AD而不是Windows身份验证?如果您已从该电脑登录到网络,我希望Internet Explorer在使用Windows身份验证时加载网页而不提示。您的情况是这样的吗?Firefox也可以配置为不提示,但默认情况下会提示。@LonProsser,我也希望如此。当我尝试从应用程序的发布位置加载应用程序时
http://project/
在本地浏览器中,我发现运行时错误:服务器上发生应用程序错误。此应用程序的当前自定义错误设置阻止远程查看应用程序错误的详细信息(出于安全原因)。但是,它可以被运行在本地服务器机器上的浏览器查看。然后当我登录到服务器机器并浏览到
http://project/
我收到上面列出的用户名/密码提示问题。
但是,被运行在本地服务器机器上的浏览器查看
错误消息是一个安全问题。默认情况下,实际消息不会显示给服务器之外访问站点的任何人。然而,当你从服务器点击它时,你会看到潜在的错误。您可能需要配置Internet Explorer以提供凭据。对于站点所在的安全区域,该选项可能被禁用(因此,请调整站点所在的安全区域,或切换安全区域)。您可以通过组策略将其发送给每个人,并与您的系统管理员联系。
<system.web>
    <authentication mode="Windows" />
      <authorization>
          <allow users="*"/>
          <deny users="?"/>
      </authorization>
    <system.web>
        <authentication mode="Windows" />
          <authorization>
              <allow users="*"/>
              <deny users="?"/>
          </authorization>
          <membership>
              <providers>
                  <remove name="OracleMemberShipProvider" />
              </providers>
          </membership>
          <roleManager>
              <providers>
                  <remove name="OracleRoleProvider" />
              </providers>
          </roleManager>
  <membership>
      <providers>
          <remove name="AspNetSqlMembershipProvider"/>
      </providers>
  </membership>
  <roleManager>
      <providers>
          <remove name="AspNetSqlRoleProvider"/>
      </providers>
  </roleManager>
  <membership>
      <providers>
          <clear />
      </providers>
  </membership>
  <roleManager enabled="false">
      <providers>
          <clear />
      </providers>
  </roleManager>
  <profile>
      <providers>
          <clear />
      </providers>
  </profile>
<?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=301880
  -->
<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=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  <sectionGroup name="elmah">
      <section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah" />
      <section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" />
      <section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah" />
      <section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah" />
    </sectionGroup>
  <section name="oracle.manageddataaccess.client" type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
  </configSections>
  <connectionStrings>
      <clear />
      <add name="OraAspNetConString" connectionString="RandomConnection" />
      <add name="LocalSqlServer" connectionString="RandomConnection"/>
      <add name="ProjectEntities" connectionString="CONNECTION LIFETIME=16;CONNECTION TIMEOUT=8;DATA SOURCE=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=host_123)(PORT=1234)))(CONNECT_DATA=(SID=hostid1)(SERVER=DEDICATED)));MIN POOL SIZE=3;PASSWORD=123_pass;PERSIST SECURITY INFO=True;USER ID=SCHEMA123" providerName="Oracle.ManagedDataAccess.Client" /></connectionStrings>
  <appSettings>
      <!--<add key="DefaultConnection" value="Default" />-->
    <add key="webpages:Version" value="3.0.0.0" />
    <add key="webpages:Enabled" value="false" />
    <add key="ClientValidationEnabled" value="true" />
    <add key="UnobtrusiveJavaScriptEnabled" value="true" />
    <add key="MvcSiteMapProvider_IncludeAssembliesForScan" value="ProjectName" />
    <add key="MvcSiteMapProvider_UseExternalDIContainer" value="false" />
    <add key="MvcSiteMapProvider_ScanAssembliesForSiteMapNodes" value="true" />
  </appSettings>
  <system.web>
    <!-- Active Directory Authentication - http://www.asp.net/mvc/overview/older-versions-1/security/authenticating-users-with-windows-authentication-cs -->
    <authentication mode="Windows" />
      <authorization>
          <allow users="*"/>
          <deny users="?"/>
      </authorization>
    <compilation debug="true" targetFramework="4.5" />
    <httpRuntime targetFramework="4.5" />
    <httpModules>
      <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Extensibility.Web.RequestTracking.WebRequestTrackingModule, Microsoft.ApplicationInsights.Extensibility.Web" />
    <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" /><add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" /><add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" /></httpModules>
    <pages>
      <namespaces>
        <add namespace="GridMvc" />
        <add namespace="MvcSiteMapProvider.Web.Html" />
        <add namespace="MvcSiteMapProvider.Web.Html.Models" />
      </namespaces>
    </pages>
  </system.web>
  <system.webServer>
    <modules>
      <remove name="FormsAuthentication" />
      <remove name="ApplicationInsightsWebTracking" />
      <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Extensibility.Web.RequestTracking.WebRequestTrackingModule, Microsoft.ApplicationInsights.Extensibility.Web" preCondition="managedHandler" />
      <remove name="UrlRoutingModule-4.0" />
      <add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" />
      <remove name="BundleModule" />
      <add name="BundleModule" type="System.Web.Optimization.BundleModule" />
    <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler" /><add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" preCondition="managedHandler" /><add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" preCondition="managedHandler" /></modules>
    <validation validateIntegratedModeConfiguration="false" />
  </system.webServer>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" />
        <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="0.0.0.0-5.2.0.0" newVersion="5.2.0.0" />
      </dependentAssembly>
      <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.5.2.14234" newVersion="1.5.2.14234" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.WebPages.Razor" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.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="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="WebMatrix.Data" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <publisherPolicy apply="no" />
        <assemblyIdentity name="Oracle.ManagedDataAccess" publicKeyToken="89b483f429c47342" culture="neutral" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
  <entityFramework>
    <contexts>
      <context type="ProjectName.DAL.ProjectNameContext, ProjectName">
        <databaseInitializer type="ProjectName.DAL.ProjectInitializer, ProjectName" />
      </context>
    </contexts>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
      <parameters>
        <parameter value="mssqllocaldb" />
      </parameters>
    </defaultConnectionFactory>
    <providers>
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
      <provider invariantName="Oracle.ManagedDataAccess.Client" type="Oracle.ManagedDataAccess.EntityFramework.EFOracleProviderServices, Oracle.ManagedDataAccess.EntityFramework, Version=6.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
    </providers>
  </entityFramework>
<elmah>
    <!--
        See http://code.google.com/p/elmah/wiki/SecuringErrorLogPages for 
        more information on remote access and securing ELMAH.
    -->
    <security allowRemoteAccess="false" />
  </elmah><location path="elmah.axd" inheritInChildApplications="false">
    <system.web>
      <httpHandlers>
        <add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" />
      </httpHandlers>
      <!-- 
        See http://code.google.com/p/elmah/wiki/SecuringErrorLogPages for 
        more information on using ASP.NET authorization securing ELMAH.

      <authorization>
        <allow roles="admin" />
        <deny users="*" />  
      </authorization>
      -->  
    </system.web>
    <system.webServer>
      <handlers>
        <add name="ELMAH" verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" preCondition="integratedMode" />
      </handlers>
    </system.webServer>
  </location>
  <system.data>
    <DbProviderFactories>
      <remove invariant="Oracle.ManagedDataAccess.Client" />
      <add name="ODP.NET, Managed Driver" invariant="Oracle.ManagedDataAccess.Client" description="Oracle Data Provider for .NET, Managed Driver" type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
    </DbProviderFactories>
  </system.data>
  <oracle.manageddataaccess.client>
    <version number="*">
      <dataSources>
        <dataSource alias="SampleDataSource" descriptor="(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1234))(CONNECT_DATA=(SERVICE_NAME=ORCL))) " />
      </dataSources>
    </version>
  </oracle.manageddataaccess.client>
</configuration>
Runtime Error

Server Error in '/' Application. Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine. 

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
Could not load file or assembly 'Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The system cannot find the file specified.

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.IO.FileNotFoundException: Could not load file or assembly 'Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The system cannot find the file specified.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Assembly Load Trace: The following information can be helpful to determine why the assembly 'Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342' could not be loaded.