0

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.

Joe Scotto
  • 10,936
  • 14
  • 66
  • 136

3 Answers3

2

.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/

Licht
  • 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
  • 1
    4.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
0

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

Wayne Cao
  • 35
  • 6
0

IIS Screenshot

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.