I'm pretty new to using C# and IIS and have been having a hard time getting my .net updated to 4.5. My application as of right now is just a single handler page with no solution hosted on a url controlled by Iis. The current version my IIS is running for that application pool is v4.0
. I want to enable v4.5 but don't know where to start. I've been searching google for the past few hours now but none of it makes any sense to me.

- 10,936
- 14
- 66
- 136
3 Answers
.Net 4.5 still uses the 4.0 CLR and that's what you're picking. You won't see an option for 4.5 here. Just ensure whatever version you want is installed and compile your application against the newer .Net versions (which go up to 4.6.2 right now) and it will be just fine.
To learn more about the difference check out this blog post: https://blogs.msdn.microsoft.com/karinm/2008/11/10/whats-the-difference-between-clr-and-net-framework/

- 1,079
- 1
- 12
- 27
-
How can I compile it if I'm just running a handler in my browser? I have no web.config or anything, just a single handler.ashx. – Joe Scotto Feb 24 '17 at 21:04
-
Are you using the setup where you have the actual code files on the server and they get compiled then? Just make sure the latest .Net version is installed and it should get used. But I admittedly have little first hand experience with this configuration. I'd recommend precompiling your files prior to publish so you know for sure what's going on. Make a new ASHX file and have it return this https://msdn.microsoft.com/en-us/library/system.environment.version(v=vs.110).aspx and you can make sure it's working properly. – Licht Feb 24 '17 at 21:07
-
I'm honestly not sure how it's getting compiled. I'm coming from a php background so this whole workflow is different to me. What I can tell you is that I have html files and my handler.ashx file in the same directory on my harddrive. The directory is a website within IIS running v4.0. I just simply want to change this v4.0 to v4.5+. – Joe Scotto Feb 24 '17 at 21:09
-
The misunderstanding you're encountering here is that CLR4.0 is used for .Net 4.5. So you have no need to change that number. Are you using Visual Studio to develop your ASHX handler? – Licht Feb 24 '17 at 21:10
-
Does that even exist ? i tought IIS pools 4.0 was made for every .net over 4.0, such as 4.5 – Antoine Pelletier Feb 24 '17 at 21:10
-
I'm using visual studio to modify the code but I don't have a solution or project setup. My version is: 4.0.30319.42000 – Joe Scotto Feb 24 '17 at 21:11
-
14.0.30319.42000 means you're using .Net Framework 4.6. And IIS says you're using .Net CLR 4.0 (which is the newest version.) So you're already done! – Licht Feb 24 '17 at 21:11
-
How come I'm not able to use `ZipFile` from .net 4.5 then? I'm using `System.IO.Compression` but still get does not exist in current context. – Joe Scotto Feb 24 '17 at 21:14
-
I'd post a new question about this. Totally different issue. I'd love to help you once you do. In that question post your code and the entire error you're getting. Then we can start to get an idea of what's going on. – Licht Feb 24 '17 at 21:17
-
http://stackoverflow.com/questions/42448485/the-name-zipfile-does-not-exist-in-the-current-context-when-including-system-i – Joe Scotto Feb 24 '17 at 21:20
Try following what's in the link. It should work :)
https://technet.microsoft.com/en-us/library/hh831475(v=ws.11).aspx
Note: you can use any .Net 45 application with v4.0 app pool

- 35
- 6
-
-
I don't see any options for 4.5. Either 4.5 or 4.6 would work, I'm just trying to get some features that were introduced in version 4.5 – Joe Scotto Feb 24 '17 at 20:51
-
-
-
@JoeScotto man you are so advanced.. try if this works for you http://stackoverflow.com/a/36473565/5196341 – Wayne Cao Feb 24 '17 at 20:55
-
I ran that earlier to get version 4 working, which it did. Just ran it again and have no option within my application pools to select v4.5+ as my clr version. Here's a link to what I see in iis. http://imgur.com/a/q8NoJ – Joe Scotto Feb 24 '17 at 20:58
-
1Oh there is no v4.5 app pool in iis. Only v4.0. You can use any .Net 4.5 application with v4.0 app pool – Wayne Cao Feb 24 '17 at 21:05
In the above screen shot click on the "application pool" and check the framework version you application is running on you can double click and change as appropriate.

- 102
- 5
-
Take a look at this image. I don't have v4.5 as an option, but I have it installed. http://imgur.com/a/q8NoJ – Joe Scotto Feb 24 '17 at 20:59
-
When you double click the application pool you will get option to change the .net framework version in a dropdown box. – Chennai Coder Feb 24 '17 at 21:01
-
-
Have you installed the .net framework version 4.5 in your machine? – Chennai Coder Feb 24 '17 at 21:02
-
When looking in "add programs or features" I have v4.6, which would be fine for what I need. I need v4.5+. – Joe Scotto Feb 24 '17 at 21:03
-
http://stackoverflow.com/questions/9559372/how-to-set-net-framework-4-5-version-in-iis-7-application-pool check out this link. – Chennai Coder Feb 24 '17 at 21:06