@@ -51,19 +51,6 @@ let Site (name : string) protocol binding (physicalPath : string) appPool (mgr :
51
51
site.ApplicationDefaults.ApplicationPoolName <- appPool
52
52
site
53
53
54
- let ApplicationPool ( name : string ) ( allow32on64 : bool ) ( runtime : string ) ( mgr : ServerManager ) =
55
- let appPool = mgr.ApplicationPools.[ name]
56
- match ( appPool) with
57
- | null ->
58
- let pool = mgr.ApplicationPools.Add( name)
59
- pool.Enable32BitAppOnWin64 <- allow32on64
60
- pool.ManagedRuntimeVersion <- runtime
61
- pool
62
- | _ ->
63
- appPool.Enable32BitAppOnWin64 <- allow32on64
64
- appPool.ManagedRuntimeVersion <- runtime
65
- appPool
66
-
67
54
let Application ( virtualPath : string ) ( physicalPath : string ) ( site : Site ) ( mgr : ServerManager ) =
68
55
let app = site.Applications.[ virtualPath]
69
56
match ( app) with
@@ -72,6 +59,28 @@ let Application (virtualPath : string) (physicalPath : string) (site : Site) (mg
72
59
73
60
let commit ( mgr : ServerManager ) = mgr.CommitChanges()
74
61
62
+ type ApplicationPoolConfig ( name : string , ? runtime : string , ? allow32on64 : bool , ? identity : ProcessModelIdentityType ) = class
63
+ member this.name = name
64
+ member this.runtime = defaultArg runtime " v4.0"
65
+ member this.allow32on64 = defaultArg allow32on64 false
66
+ member this.identity = defaultArg identity ProcessModelIdentityType.ApplicationPoolIdentity
67
+ end
68
+
69
+ let private MergeAppPoolProperties ( appPool : ApplicationPool )( config : ApplicationPoolConfig ) =
70
+ appPool.Enable32BitAppOnWin64 <- config.allow32on64
71
+ appPool.ManagedRuntimeVersion <- config.runtime
72
+ appPool.ProcessModel.IdentityType <- config.identity
73
+ appPool
74
+
75
+ let ApplicationPool ( config : ApplicationPoolConfig ) ( mgr : ServerManager ) =
76
+ let appPool = mgr.ApplicationPools.[ config.name]
77
+ match ( appPool) with
78
+ | null ->
79
+ let pool = mgr.ApplicationPools.Add( config.name)
80
+ MergeAppPoolProperties pool config
81
+ | _ ->
82
+ MergeAppPoolProperties appPool config
83
+
75
84
let IIS ( site : ServerManager -> Site )
76
85
( appPool : ServerManager -> ApplicationPool )
77
86
( app : ( Site -> ServerManager -> Application ) option ) =
0 commit comments