0

We have migrated an application from Net version 3.5 to 4.8. The truth is that we are encountering many problems. Everything seems right, but it doesn't seem to work returns a 500 error without any more information. My approach is that it is not running with the correct version of Net. Therefore, install version 4.8 of the following link: Net 4.8 Framework for Windows Server 2016. It still doesn´t work. I still have my doubts, how can I know which version of Net 4.8 is using my application, considering that I do not have access to Windows Features?

Could you check this information from here?

Configuration APP

Kenzo_Gilead
  • 2,187
  • 9
  • 35
  • 60
  • Usually before you deploy an app to a server you run it locally, right? Can u run the app in your dev environment? Usually with CLR 4.0 windows supports all .NET versions up to version 4.8. So you shouldnt run into any errors there. But please confirm the software runs with 4.8 at all since this is a major change – Aaron Apr 05 '23 at 08:44
  • @Aaron. Yes, we test it first in local and it works fine. Many Thanks for your response. – Kenzo_Gilead Apr 05 '23 at 08:45
  • Have you got some logging turned on to see where the error occurs? However please open IIS and check in the application pools the not working application (pool) and select advanced setting. There should be something regardig the .net version i suppose – Aaron Apr 05 '23 at 08:48
  • @Aaron. I can´t see so much in the LOGs. There are a lot of information without meaning for me. In Advanced Settings I find "Net CLR Version = 4.0" "Pipeline Mode = Integrated". Many Thanks – Kenzo_Gilead Apr 05 '23 at 08:59
  • The right solution is to publish application and install using setup.exe like any commercial software package. Publish updates the windows dll on deploy machine to match the build machine. A net application will only work if you deploy or use same version of net (including updates) on both build and deploy machine. – jdweng Apr 05 '23 at 09:46
  • @jdweng. We deploy this application in the server by DevOps. Do you think this is not enough? By the other hand, where is stored the setup.exe? This application is a Web Services just with a DDD architecture with different layers. We don´t have debug or bin folders. Many Thanks for your response. – Kenzo_Gilead Apr 05 '23 at 09:52
  • Did you set the UserAgent in the HTTP Header which indicates the WebBrowse compatibility that is used to process the request? Also see : https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/?force_isolation=true&view=aspnetcore-7.0 – jdweng Apr 05 '23 at 10:13
  • @jdweng. Mmmm... I dont and it looks that it could be. Please, could you indicate me how to do it? – Kenzo_Gilead Apr 05 '23 at 10:18
  • User agent is a HTTP Header and you add like any other HTTP Header. See : https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent?force_isolation=true – jdweng Apr 05 '23 at 10:24
  • Ignore jdweng, they're a known troll loving to give misinformation. No, you don't need to deploy IIS web applications with a setup.exe, and you don't need a "WebBrowse compatibility" header to have the server select the correct .NET Framework runtime, and that _definitely_ isn't triggered by the User Agent header. – CodeCaster Apr 05 '23 at 10:24
  • @CodeCaster. Oh, ok. Many Thanks. Can this user be banned please? – Kenzo_Gilead Apr 05 '23 at 10:26
  • I'm afraid not. Anyhow, you need to check the Event Viewer to see if any errors are logged. Alternatively, enable custom errors to see the exception messages. – CodeCaster Apr 05 '23 at 10:30
  • @CodeCaster. I tried both, but I didnt see any significant message. Dont you have a random idea by a chance please? – Kenzo_Gilead Apr 05 '23 at 10:31
  • If there's no exception message logged nor printed, I don't know either. Doesn't this problem manifest itself locally? Are there custom (global) error handlers being registered? Is all code wrapped in try-catch-return 500? – CodeCaster Apr 05 '23 at 10:49
  • Emmm, 500 error without detailed information is really a tricky problem. Have you tried Failed Request Tracing since the event viewer doesn't provide much more information? It's also hard for community members to give useful advice if there's no exception message logged nor printed. – TengFeiXie Apr 06 '23 at 09:32
  • @TengFeiXie. Thnaks for your help. I tried to check Failed Request Tracing with another member of the community but we didn´t see any relevant. The error looks like a 404 by this trace and dont say anything about the 500. Weird. Thanks again. – Kenzo_Gilead Apr 07 '23 at 09:25

1 Answers1

0

Seems like there may be two issues here.

First: Which versions of .net are installed and running on IIS. Check out this q to which versions are on IIS and are used by the AppPool. Which version of the .NET Framework is IIS using for my AppPool?

Secondly is possible (though not likely from what you described) that the web app is using a an older version of .net or maybe a library targeting an older version of .net If you built the app double check any libraries and DLLS to see what version they target. You can try Telerik's "justdecompile" tool (it's free) if you need to look at third party dlls.

Jojo-Ohio
  • 23
  • 6
  • Thanks for your response. Net CLR is version 4 and We have migrated this project in local first and all libraries and DLLs looks fine. – Kenzo_Gilead Apr 07 '23 at 09:26