【问题标题】:iis 7.5 - simplest way of creating a virtual directoryiis 7.5 - 创建虚拟目录的最简单方法
【发布时间】:2017-10-05 21:22:14
【问题描述】:

创建虚拟目录最简单的方法是什么?我以前用过 iis 6.0,但现在用的是 iis 7.5

  • 我右键单击站点文件夹
  • 点击添加网站
  • 输入物理路径和别名
  • 点击确定

它说

绑定 80 被分配到不同的站点

  • 当我在主机名框中输入另一个短名称时,它接受但

在测试设置上它会清除身份验证并在授权时发出警告

服务器配置为使用直通身份验证 内置帐户访问指定的物理路径。然而,IIS Manager 无法验证内置帐户是否具有访问权限。制作 确保应用程序池标识对 物理路径。如果此服务器已加入域,并且 应用程序池标识为 NetworkService 或 LocalSystem,验证 \$ 对物理路径具有读取权限。 然后再次测试这些设置。

当我尝试从虚拟目录浏览时

页面无法显示

我还进入了“编辑权限”,并为那里的所有用户提供了完全控制权。

此外,当我在虚拟目录中展开我的文件夹时,没有显示 .cshtml 页面:S

更新

我也试过了:

  • 右键单击默认网站
  • 添加虚拟目录

它被创建为默认网站下的子文件夹

现在当我浏览时出现不同的错误

在应用程序级别之外使用注册为 allowDefinition='MachineToApplication' 的部分是错误的。此错误可能是由于虚拟目录未在 IIS 中配置为应用程序所致。

当我在此目录中尝试“转换为应用程序”时

它说

“无效的应用程序路径”

我给出的物理路径为

C:\ge.Web

其中包含

  • web.config
  • 视图(文件夹)
  • App_Start(文件夹)
  • App_Data(文件夹)
  • ...(等)

我的全局 Web.Config 是:

<configuration>
  <configSections>
<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 name="geContext" connectionString="XXX" />

</connectionStrings>

<appSettings>
  <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" />
</appSettings>
<system.web>
  <authentication mode="Forms" />
  <compilation debug="true" targetFramework="4.5.1" />
  <httpRuntime targetFramework="4.5.1" />
  <pages></pages>
<profile>

</profile><siteMap>

</siteMap><webParts>
  <personalization>

  </personalization>
</webParts></system.web>
<system.webServer>
  <modules>
    <remove name="FormsAuthenticationModule" />
  </modules>
</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-3.0.0.0" newVersion="3.0.0.0" />
    </dependentAssembly>
    <dependentAssembly>
      <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
      <bindingRedirect oldVersion="1.0.0.0-5.1.0.0" newVersion="5.1.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="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
      <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.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="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
      <bindingRedirect oldVersion="0.0.0.0-6.9.9.0" newVersion="6.9.9.0" />
    </dependentAssembly>
    <dependentAssembly>
      <assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" />
      <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
    </dependentAssembly>
  </assemblyBinding>
</runtime>
<entityFramework>
  <defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.Entity.EF6">    
  </defaultConnectionFactory>
  <providers>
    </providers>
</entityFramework>
<system.data>
  <DbProviderFactories>

   </DbProviderFactories>
</system.data>

【问题讨论】:

    标签: asp.net iis iis-7


    【解决方案1】:

    步骤:

    1. 右键默认网站 -> 添加虚拟目录
    2. 提供别名、物理路径
    3. 现在右键单击您的网站,例如网站1
    4. 点击编辑权限
    5. 转到“安全”选项卡并让所有用户完全控制
    6. 在全局 Web.Config 中找到

    替换为

    <add key="webpages:Enabled" value="true" />
    

    这将在 iis 中显示 .cshtml 页面

    检查 Views 文件夹下的 Web.Config 中没有覆盖

    1. 现在右键单击 Website1 并单击 转换为应用程序
    2. 点击添加。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-06-11
      • 1970-01-01
      • 1970-01-01
      • 2010-09-20
      • 2020-12-22
      • 1970-01-01
      相关资源
      最近更新 更多