0

I have written an ASP.NET Core Web API, and published it on my plesk (hosting) web server, but it is not working - it is working in my test environment (localhost).

Important to know that my plesk (hosting) server use the version 4.8 of the .NET Framework and my API uses .NET Core 6; is that the reason it doesn't work? (I use the version 4.8 cause my web server host a website in webforms).

Here's the url to access the api on the web that throws an error 500 (any call return that)

https://apinhl.nhldynastypool.com/NHLAHLStatsAndSalaryInfo 

In the screenshot below, I will post the file tree that I have in plesk (hosting) maybe it has something to do.

1

2

I have tried many thing but nothing seems to work I really need your help I do not have a clue what to do now it is the first time I try to deploy a web api and sorry for my bad English my main language is French :)

vimuth
  • 5,064
  • 33
  • 79
  • 116
  • 1
    Without seeing your code, there is nothing we can do. An error 500 means your code crashed. Don't you have logs? What .NET version did you specify when you build the app? If you specified 6.0, then of course it's going to crash. You can set the target .NET version when you build. – Tim Roberts Dec 24 '22 at 02:22
  • thank you man but in my code the only tartget framework i had is .net 6, .net 5, .net core 1.0 , .netcore 2.0 ,.netcore 2.1, .netcore 2.2, .netcore 3.0, .netcore 3.1 but in my plesk i only have ASP.NET 4.8 and ASP.NET3.5 @TimRoberts wich one i should take (im a beginner) – sauro1997 Dec 24 '22 at 02:35
  • Are you using Visual Studio? You may need to redo setup and select the 4.8 tools. https://stackoverflow.com/questions/58000123/visual-studio-cant-target-net-framework-4-8 – Tim Roberts Dec 24 '22 at 02:51
  • yeah i use vs studio the ide i will try thanks a lot – sauro1997 Dec 24 '22 at 03:59
  • does Tim's suggestions help you solve your issue? – Tiny Wang Dec 26 '22 at 02:53

1 Answers1

0

No cause i have to go to .net core 2.1 to work on .net framework 4.8 and all my code broke lol so i guess i have no other chpice to rewrote it in .net 4.8 framework in a webapp project

sauro
  • 1
  • 1
  • Plesk Obsidian 18.0.41 is supporting .net core 6.0 (https://support.plesk.com/hc/en-us/articles/115000442805-ASP-NET-Core-support-in-Plesk) – Parth M. Dave Dec 26 '22 at 13:26
  • but the .net framework i got on plesk is 4.8.0 and when i run my .net core 6 on it it return me error 500 (but i need to have the 4.8 version cause my other website run .net framework 4.8) – sauro1997 Dec 26 '22 at 13:55