【问题标题】:Visual Studio 2013 and ASP.NET Web Configuration ToolVisual Studio 2013 和 ASP.NET Web 配置工具
【发布时间】:2013-12-30 18:09:36
【问题描述】:

我使用的是 Visual Studio 2013,您可能知道没有 ASP.NET Web 配置工具。我想像往常一样制作快速角色等。我尝试使用这篇文章启用它:http://blogs.msdn.com/b/webdev/archive/2013/08/19/asp-net-web-configuration-tool-missing-in-visual-studio-2013.aspx?PageIndex=2#comments。但我收到“无效的应用程序路径”错误。此错误的任何解决方案或变通方法?

【问题讨论】:

    标签: visual-studio visual-studio-2013


    【解决方案1】:

    在控制台上,复制并粘贴此处所写的内容:

    "C:\Program Files\IIS Express\iisexpress.exe" /path:c:\windows\Microsoft.NET\Framework\v4.0.30319\ASP.NETWebAdminFiles /vpath:"/asp.netwebadminfiles" /port:8089 /clr:4.0 /ntlm
    

    不管你是否以管理员权限打开cmd.exe,只需将上面的代码复制粘贴到控制台,完成之前不要用“q”退出!

    然后打开浏览器窗口并在地址栏上写下:

    http://localhost:8089/asp.netwebadminfiles/default.aspx?applicationPhysicalPath=[Exact_Project_Path]\&applicationUrl=/
    

    请务必从 Windows 资源管理器中复制并粘贴您的项目路径,它会起作用 ;)

    希望微软在下一次 VS2013 更新中添加这个功能!任何人都不能像过去那样为了处理会员资格而复制粘贴代码...

    希望有帮助!

    重要编辑:对不起,我刚刚意识到如果您以管理员权限启动控制台很重要。不要那样做。如果控制台具有管理员权限,则 Web 配置工具会在安全页面上显示此错误:

    您选择的数据存储存在问题。这可能是由无效的服务器名称或凭据引起的,或者是由于服务器名称或凭据不足引起的 允许。它也可能是由角色管理器功能引起的 被启用。点击下面的按钮被重定向到一个页面 您可以选择一个新的数据存储。以下消息可能有助于 诊断问题:访问路径 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\1c3fef5c\2180c7f9\hash' 被拒绝。

    【讨论】:

    • @capcode01 如果它要求输入用户名和密码,那是您 PC 的用户帐户和密码
    • 那么我强烈建议您立即为您的用户名创建密码。这是用户在购买新计算机或安装新操作系统后应该做的第一件事。 ;)
    • 我很乐意提供帮助 ;)
    • 不要将第二行直接粘贴到地址栏中。将 [Exact_Project_Path] 更改为包含 webconfig 文件的项目目录。 c:\mywebApp1 (我假设 myWebApp1 目录有一个 webconfig 文件。)如果你这样做。它不会询问任何用户名或密码。
    • 小心 "C:\Program Files\IIS Express\iisexpress.exe" /path:c:\windows\Microsoft.NET\Framework\v4.0.30319\ASP.NETWebAdminFiles /vpath:"/asp.netwebadminfiles" /port:8089 /clr:4.0 /ntlm 以 64 位运行 IIS。如果要以 32 位运行 IIS Express,则必须使用 "C:\Program Files (x86)\IIS Express\iisexpress.exe" /path:c:\windows\Microsoft.NET\Framework\v4.0.30319\ASP.NETWebAdminFiles /vpath:"/asp.netwebadminfiles" /port:8089 /clr:4.0 /ntlm(IIS 8 及更高版本)。希望能帮助你摆脱头痛:)
    【解决方案2】:

    如果系统要求您输入用户名和密码,请执行以下操作:

    1. 打开 Firefox 并输入 about:config 作为 url
    2. 在“ntlm”的过滤器类型中
    3. 双击“network.automatic-ntlm-auth.trusted-uris”并输入“localhost”并回车

    来源:http://forums.codecharge.com/posts.php?post_id=81959

    【讨论】:

    • 我试过这个。它仍然要求输入用户名和密码。
    • 提供您的 Windows 登录凭据
    【解决方案3】:

    我从here 下载了一个名为“Credentials Manager for WCF”的开源实用程序。它需要以下配置才能工作。
    对于配置,您应该编辑项目“CredentialServiceHost”的配置文件如下:

        *<?xml version="1.0"?>
    <configuration>
        <connectionStrings>
        <clear />
            <add name="AspNetDbConnectionString" connectionString="[Your data base connection string]" providerName="System.Data.SqlClient"/>
        <add name="LocalSqlServer" connectionString="[Your data base connection string]" providerName="System.Data.SqlClient"/>
    
    
      </connectionStrings>
        <system.web>
            <authentication mode="None"/>
      <roleManager enabled="true"/>
        </system.web>
        <system.serviceModel>
            <services>
                <service name="AspNetSqlProviderService" behaviorConfiguration="MEX Enabled">
                    <endpoint address="" binding="wsHttpBinding" bindingConfiguration="TransactionalWS" contract="IApplicationManager"/>
                    <endpoint address="" binding="wsHttpBinding" bindingConfiguration="TransactionalWS" contract="IMembershipManager"/>
                    <endpoint address="" binding="wsHttpBinding" bindingConfiguration="TransactionalWS" contract="IPasswordManager"/>
                    <endpoint address="" binding="wsHttpBinding" bindingConfiguration="TransactionalWS" contract="IRoleManager"/>
                    <endpoint address="" binding="wsHttpBinding" bindingConfiguration="TransactionalWS" contract="IUserManager"/>
                </service>
            </services>
            <bindings>
                <wsHttpBinding>
                    <binding name="TransactionalWS" transactionFlow="true">
                        <reliableSession enabled="True"/>
                    </binding>
                </wsHttpBinding>
            </bindings>
          <behaviors>
             <serviceBehaviors>
                <behavior name="MEX Enabled">
                   <serviceMetadata httpGetEnabled="true"/>
                </behavior>
             </serviceBehaviors>
          </behaviors>
        </system.serviceModel>
    <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
    

    对于项目“CredentialsManager”,您应该使用以下配置:

    <?xml version="1.0"?>
    <configuration>
       <configSections>
          <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
             <section name="CredentialsManagerClient.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
          </sectionGroup>
       </configSections>
       <applicationSettings>
          <CredentialsManagerClient.Properties.Settings>
             <setting name="AspNetSqlProviderService" serializeAs="String">
                <value>http://localhost:8000</value>
             </setting>
          </CredentialsManagerClient.Properties.Settings>
       </applicationSettings>
       <system.serviceModel>
          <client>
             <endpoint address="http://localhost:8000/" binding="wsHttpBinding" bindingConfiguration="TransactionalWS" contract="IApplicationManager"/>
             <endpoint address="http://localhost:8000/" binding="wsHttpBinding" bindingConfiguration="TransactionalWS" contract="IMembershipManager"/>
             <endpoint address="http://localhost:8000/" binding="wsHttpBinding" bindingConfiguration="TransactionalWS" contract="IPasswordManager"/>
             <endpoint address="http://localhost:8000/" binding="wsHttpBinding" bindingConfiguration="TransactionalWS" contract="IRoleManager"/>
             <endpoint address="http://localhost:8000/" binding="wsHttpBinding" bindingConfiguration="TransactionalWS" contract="IUserManager"/>
          </client>
          <bindings>
             <wsHttpBinding>
                <binding name="TransactionalWS" transactionFlow="true">
                   <reliableSession enabled="True"/>
                </binding>
             </wsHttpBinding>
          </bindings>
       </system.serviceModel>
    <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
    

    以管理员身份运行“CredentialsServiceHost.exe”文件,然后运行“CredentialsManager.exe”文件。

    【讨论】:

      【解决方案4】:

      这确实对我有用,直到创建一个安全角色,然后是一个用户,但是当我尝试运行我的网站时收到以下消息 HTTP 错误 403.14 - 禁止

      Web 服务器配置为不列出此目录的内容。 最可能的原因: • 请求的 URL 未配置默认文档,服务器上未启用目录浏览。

      您可以尝试的事情: •如果您不想启用目录浏览,请确保配置了默认文档并且该文件存在。 • 启用目录浏览。 1.转到 IIS Express 安装目录。 2.运行 appcmd set config /section:system.webServer/directoryBrowse /enabled:true 启用服务器级别的目录浏览。 3.运行appcmd set config ["SITE_NAME"] /section:system.webServer/directoryBrowse /enabled:true 启用站点级别的目录浏览。

      •验证站点或应用程序配置文件中的 configuration/system.webServer/directoryBrowse@enabled 属性是否设置为 true。

      【讨论】:

      • 迁移到身份框架对我来说可能是也可能不是一个选项。我有兴趣知道为什么在应用所有步骤后它对我不起作用。即使我使用 appcmd 命令启用目录浏览,我仍然会不断收到上述错误。目前不知道如何进行。
      猜你喜欢
      • 2013-11-06
      • 2015-09-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-12-19
      • 2016-02-11
      相关资源
      最近更新 更多