gpt4 book ai didi

asp.net-mvc - 如何使用 WIX 在 IIS 6 上安装 ASP.NET MVC 3 应用程序?

转载 作者:行者123 更新时间:2023-12-04 23:26:06 26 4
gpt4 key购买 nike

以下是安装到 IIS-6 时的一些注意事项:

  • 需要注册 ASP.NET 4(可能使用 aspnet_regiis.exe)
  • 需要同时支持 ASP.NET v2 和 v4
  • 需要注册aspnet_isapi.dll支持通配符映射

  • 这是我到目前为止所拥有的:
    <iis:WebDirProperties Id='WebDirProperties' Script='yes' Read='yes
    Execute='no' WindowsAuthentication='yes' AnonymousAccess='no'
    AuthenticationProviders='NTLM,Negotiate' />

    <!-- SO has some good posts on selecting the website from a dropdown -->
    <iis:WebSite Id='SelectedWebSite' Directory='WWWROOT' SiteId='[WEBSITE_ID]' Description='[WEBSITE_DESCRIPTION]'>
    <iis:WebAddress Id='AllUnassigned' Port='80' IP='*'/>
    </iis:WebSite>

    <Component Id="ProjWebApp" Guid="{B4BE9223-7109-4943-AE4E-8F72FA350D02}"
    Win64="$(var.IsWin64)" NeverOverwrite="yes" Transitive="yes">
    <CreateFolder/>

    <iis:WebAppPool Id="ProjAppPool" Name="[APPPOOLNAME]" Identity="networkService"
    ManagedRuntimeVersion="v4.0" ManagedPipelineMode="integrated" />
    <iis:WebVirtualDir Id="ProjVDir" DirProperties="WebDirProperties"
    Alias="[WEBAPPNAME]" Directory="WEBFILESDIR" WebSite="SelectedWebSite">
    <iis:WebApplication Id="ProjApp" Name="[WEBAPPNAME]" WebAppPool="ProjAppPool">
    <iis:WebApplicationExtension
    CheckPath="no"
    Script="yes"
    Executable="[ASPNETISAPIDLL]"
    Verbs="GET,HEAD,POST"
    />
    </iis:WebApplication>
    </iis:WebVirtualDir>
    </Component>

    <!-- other apps may start using it once installed so it must be permanent -->
    <Component Id="EnableASPNet4Extension" Permanent="yes" Guid="{C8CDAB96-5DDC-4B4C-AD7E-CD09B59F7813}">
    <iis:WebServiceExtension Id="ASPNet4Extension" Group="ASP.NET v4.0.30319"
    Allow="yes" File="[ASPNETISAPIDLL]" Description="ASP.NET v4.0.30319"
    UIDeletable="no"
    />
    </Component>

    我有一个自定义操作来向 IIS 注册 ASP.NET:
    <?if $(var.Platform) = x64 ?>
    <CustomAction Id="SetProperty_AspNetRegIIS_InstallNet40Cmd"
    Property="AspNetRegIIS_InstallNet40Cmd"
    Value="&quot;[NETFRAMEWORK40FULLINSTALLROOTDIR64]aspnet_regiis.exe&quot; -ir"/>
    <?else?>
    <CustomAction Id="SetProperty_AspNetRegIIS_InstallNet40Cmd"
    Property="AspNetRegIIS_InstallNet40Cmd"
    Value="&quot;[NETFRAMEWORK40FULLINSTALLROOTDIR]aspnet_regiis.exe&quot; -ir"/>
    <?endif?>

    问题

    这几乎有效。此时有两个问题:
  • IIS 扩展不考虑 IIS-6 上的托管运行时版本,因此应用程序没有 ASP.NET 版本集。
  • 如果我使用 aspnet_regiis.exe -s APP_PATH在创建后注册它,它会覆盖通配符映射(我不知道可以运行的命令行来恢复它)。

  • 鉴于上述缺点,当已经安装了 ASP.NET 2 时,如何使用 WIX 将 ASP.NET MVC 3 应用程序安装到具有适当通配符映射的 IIS-6 上?

    最佳答案

    事实证明,这对我来说是一个愚蠢的错误。当我没有包括的部分(自定义操作和属性定义)正确时,上述内容足以使 ASP.NET v4 应用程序工作。

    就我而言,我不小心引用了 aspnet_isapi.dll 的路径。 ,所以它实际上并没有被正确拾取。

    The IIS extension doesn't respect the managed runtime version on IIS-6, so the application doesn't have an ASP.NET version set.



    这是部分正确的。尽管在设置应用程序池时它不使用托管运行时版本,但 IIS 实际上会在出现问题时立即获取 ASP.NET 版本 正确 映射到 aspnet_isapi.dll .一旦我修复了路径,一切正常。

    If I use aspnet_regiis.exe -s APP_PATH to register it once it's created, it overwrites the wildcard mapping (and I don't know a commandline that I can run to restore it).



    您可以使用 adsutil.vbs为了在需要时进行管理:
    C:\Inetpub\AdminScripts>adsutil.vbs enum w3svc/998577302/root/AppName
    KeyType : (STRING) "IIsWebVirtualDir"
    ...
    ScriptMaps : (LIST) (1 Items)
    "*,C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll,1,GET,HEAD
    ,POST"

    通过使用 set adsutil.vbs 中的命令您可以设置 ScriptMaps根据需要的属性(property)。

    关于asp.net-mvc - 如何使用 WIX 在 IIS 6 上安装 ASP.NET MVC 3 应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8702587/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com