C# 已发布的asp.net不断请求登录凭据

C# 已发布的asp.net不断请求登录凭据,c#,asp.net,iis,web-config,C#,Asp.net,Iis,Web Config,我正在尝试将一个测试网站发布到一个托管服务,我相信它正在运行IIS8.0。我使用了visual studio 2015构建->发布和设置ftp配置文件 网站已发布,但仅当我在根级别输入凭据时,它才起作用。在我的配置文件中,我选择了发布版本,但问题是无论我使用调试还是发布版本,问题仍然存在 我看了看这条线,但没用 由于网站是托管在托管服务上的,所以我无法控制IIS 8.0。它是可以远程修复的东西 以下是web.config文件: <configuration> &

我正在尝试将一个测试网站发布到一个托管服务,我相信它正在运行IIS8.0。我使用了visual studio 2015构建->发布和设置ftp配置文件

网站已发布,但仅当我在根级别输入凭据时,它才起作用。在我的配置文件中,我选择了发布版本,但问题是无论我使用调试还是发布版本,问题仍然存在

我看了看这条线,但没用

由于网站是托管在托管服务上的,所以我无法控制IIS 8.0。它是可以远程修复的东西

以下是web.config文件:

    <configuration>
      <system.web>
        <compilation targetFramework="4.5.2" />
        <httpRuntime targetFramework="4.5.2" />
        <httpModules>
          <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" />
        </httpModules>
      </system.web>
      <system.codedom>
        <compilers>
          <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701" />
          <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+" />
        </compilers>
      </system.codedom>
      <system.webServer>
        <validation validateIntegratedModeConfiguration="false" />
        <modules>
          <remove name="ApplicationInsightsWebTracking" />
          <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" preCondition="managedHandler" />
        </modules>
      </system.webServer>
      <appSettings>
        <add key="ValidationSettings:UnobtrusiveValidationMode" value="None" />
      </appSettings>
    </configuration>

谢谢大家!

通过更改web配置将身份验证类型更改为
匿名身份验证

<configuration>
  <system.web>
       <authorization>
         <allow users="?"/>
       </authorization>
   </system.web>
</configuration>

我唯一让它工作的方法是从托管公司最初在默认模板网站上的Web.Config复制此节(我更改了密钥,但它只是一个很长的AES密钥)


...
然而,我不知道这个密码是如何生成的。有人知道这是否可以从asp控制面板生成吗?我还是没办法


谢谢。

对我来说没什么不同,但我用了不同的方式,看看我自己的答案。还有一些事情我不明白
<configuration>
  <system.web>
       <authorization>
         <allow users="?"/>
       </authorization>
   </system.web>
</configuration>
    <system.webServer>
        <!--No sure why I have to have this-->
        <security>
          <authentication>
            <!--How did this get generated?-->
            <anonymousAuthentication password="[enc:AesProvider:3436xsIasdj8M264Fs73<somelengthykey>DFHDFGlrrh345YaOXmhpI=:enc]" />
          </authentication>
        </security>
        <validation validateIntegratedModeConfiguration="false"/>
        ...
    </system.webServer>