Possible to set runtime version?

38 views
Skip to first unread message

Aaron Huber

unread,
Dec 16, 2014, 9:47:48 PM12/16/14
to ironf...@googlegroups.com
Trying to look through the code but I'm getting lost.  :-)  I see in the code for iishost.exe that it's possible to pass either "2.0" or "4.0" for the runtime version to a container, but I can't figure out how that would get passed in.  Is there a way to specify that when pushing an app?  An environment variable, perhaps?

Aaron Huber
Intel Corporation

Chris Sterling

unread,
Dec 17, 2014, 2:38:54 PM12/17/14
to ironf...@googlegroups.com
Have you already tried using <supportedRuntime> in your config?


Currently, the CLR buildpack uses 4.0.30319 as its default CLR version:


We are trying to test out how the <supportRuntime> affects the CLR execution now but don't have any answers yet. It looks like the "2.0" vs. "4.0" is used when Windows run the IIS command with arguments:

Line 315

We are currently using .NET 4.5 on Windows Server and therefore the expectation would be that we support versions that are compatible:


We will do some more investigation. Just for context, what are you trying to deploy on Iron Foundry that would necessitate a specific version?

Aaron Huber

unread,
Dec 17, 2014, 6:57:35 PM12/17/14
to ironf...@googlegroups.com
This was more of a background question so we know how it works if/when a customer asks us how to deploy an app that needs the 2.0 CLR.  My understanding is that you need to set the app pool to run using either the 2.0 or 4.0 CLR, and then inside the CLR you can target a specific version (2.0 CLR runs 2.0, 3.0, and 3.5 and the 4.0 CLR runs 4.0, 4.5, 4.5.1, 4.5.1).  The Iron Foundry code (iishost.exe) which kicks off an app has a command line option to start with an app pool running either 2.0 or 4.0 CLR (https://github.com/cloudfoundry-incubator/if_warden/blob/master/IronFoundry.Warden.IISHost/Program.cs), but we can't see any way to pass that option from CF to the running instance.

For example, I could imagine that if we set a RUNTIME_VERSION environment variable via CF and then pushed the app, that would get picked up and then iishost.exe would be kicked off with the "-v 2.0" option.  At present there is a ps1 file written inside each container that has the start command for iishost.exe, but I can't find the code that creates that ps1 file.

It may be that iishost.exe has the ability to set the version even though that's not possible to configure via an application push, which is what I want to confirm.  So either it's possible and I just want to document how to configure it for future reference, or if it's not currently possible then I'd request that feature be added.  :-)  This would be a low priority as we haven't even been asked about it yet, but it would definitely fall under the "cool to have" category.

Aaron Huber
Intel Corporation
Reply all
Reply to author
Forward
0 new messages