error 500 on plesk(hosting) with my .net core webapi but work good in test (localhost) help me pleaaase - asp.net-core

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.
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 :)

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

Related

Elmah for .NET Core - manually logging

I've got an app that has elmah embedded in it for error logging. That app runs .net framework 4.x and uses a sql server backend. It is hosted up in azure.
I am porting the app the .net core and to connect to the same database. I've been googling, but can't find a way to manually enter an error into elmah under asp .net core. I need to store more information than just errors. I'm sure that the problem is with my searching on how to do this, so if someone could help a dumb soul and say how to do it, I would appreciate it.
TIA,
Wally
Have you tried HttpContext.RiseError(new InvalidOperationException("Test")); as mentioned in the https://github.com/ElmahCore/ElmahCore/#rise-exception ?

Changing host name on development machine for ASP.net Core 2.1 MVC doesn't work (fine on MVC 5)

I want to change the local host name so http://localhost/app1 could, say, become http://app1 - for a few different ASP.net Core 2.1 MVC websites.
I'm using IIS in Windows 10. (I have all sorts of reliability issues with IIS Express every time I try it - I'd rather use full IIS).
I've followed this article:
https://www.mojoportal.com/adding-a-host-name-to-the-hosts-file-for-local-testing
changing the hosts file then adding new websites in IIS rather than adding applications under the default website.
I want to do this for various reasons including preventing passwords from autofilling across many websites on localhost.
This works fine on MVC 5 sites - but in .net Core 2.1 MVC sites I get a
HTTP Error 502.5 - Process Failure
If I look in the log - and I've tried this on various sites - I get an error such as this:
An assembly specified in the application dependencies manifest
(AppName.deps.json) was not found:
package: 'Stripe.net', version: '19.8.0'
path: 'lib/netstandard1.2/Stripe.net.dll'
This doesn't only happen for Stripe.
The deps.json file I guess is being dynamically created - I can't find it. The sites deploy to the server fine.
Why does this happen - and how can I change hostname away from localhost for .net core 2.1 MVC sites?
If I create a template .net Core 2.1 MVC site it lets me do it fine, strangely but can see no obvious differences.
I can't find anything on Google directly about this though I've looked for a few hours.
I found this - but it didn't help:
ASP .NET Core 2.0 Change "localhost" to a "hostname"
Thanks.
Update
A vanilla .net core mvc 2.1 application works fine but as soon as 1 nuget package is installed this error happens again:
An assembly specified in the application dependencies manifest
(hosttest.deps.json) was not found
So there's some path issue to nuget packages - can't find how to fix it though.

Windows Server 2003 64bit IIS 6.0 Service Unavailable

I created a MVC 4 Web Api and ran all the configurations to get it running, but I get the error mentioned above.
The event log says I am running two version of .NET
I have enabled 32 bit applications on the server
This is the proof of .NET 4 Registration:
This is the error I am getting:
The setup for above error:
Clicking on configure from above screen:
Clicking on edit:
If I change the wildcard mapping dll to the follwing
I get this error, as you can see it says I am running version 2 of .net which is not true according to the first screenshot, I have tried iisreset to not avail:
The wild card mappings are used for clean url's when using MVC 4 web api.
This is the setup in IIS:
Can someone maybe guide me to a solution for this?
EDIT:
These are the resources for the initial setup I did:
http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx
http://johan.driessen.se/posts/getting-an-asp.net-4-application-to-work-on-iis6
Basically the IIS has framework 4 registered but it is using framework 2 when I try and load the api.

ASP.NET MVC 4 app gives 404, IController error on IIS 7.5/8

The last couple of days I've been trying to deploy MVC 4 applications to IIS 7.5 and 8 installations on Server 2008 R2 and 2012, but I'm basically getting the same error every time: 404 and "The controller for path '/' was not found or does not implement IController." On both servers I've made sure that .NET 4, 4.5 and the full MVC 4 stack are installed. The applications run fine on IIS Express in VS 2012.
Things I've tried and results:
Tried to deploy a clean MVC 3 applicaion: works;
Tried to deploy a clean MVC 4 application: doesn't work;
Tried to deploy a clean ASP.NET 4 WebForms application: works (which, I think, rules out the ASP.NET hosting capabilities being a problem);
Tried to deploy the MVC 4 apps with .NET 4 instead of 4.5: doesn't work (which, I think, rules out the .NET installations being the problem);
Tried to install hotfix 980368: installer says 'This update is not applicable to your computer', so that is probably already installed;
Made sure the app pool is on .NET 4.0;
Made sure all file permissions are setup properly;
Changed verbs on ExtensionlessUrlHandler-Integrated-4.0 to *;
Added the <modules runAllManagedModulesForAllRequests="true" /> tag.
But still no dice... I've read many SO questions and other websites which resemble the errors I'm getting, and I think I've tried all the tips I've read, but maybe I missed a crucial one.
Has anyone else experienced these problems, that can give me the fix I need?
Right, as it seems, adding the debug symbols (.pdb) to the bin folder makes the app start working again, even though it was deployed in Release mode. I'll do some research as to why this happens.
Edit: the answer can be found here: Removing .pdb from ASP.NET app on IIS breaks application

Adding WCF Web Service to a DotNetNuke site.. Easiest way?

What kind of project should I use ? I tried a WCF web site and then copied the directory into my DNN site and tried to goto the .svc file without success. Is DNN 6 for 3.5 only? Should I be running it as integrate and 4.0 in iis ?
The value for the 'compilerVersion' attribute in the provider options must be 'v4.0' or later if you are compiling for version 4.0 or later of the .NET Framework. To compile this Web application for version 3.5 or earlier of the .NET Framework, remove the 'targetFramework' attribute from the element of the Web.config file.
DNN has supported .NET 4 since DNN 5.4 (or thereabouts) and supports integrated mode in IIS (since early DNN 5.x).
It sounds like maybe you copied over the DNN web.config, which isn't going to work (there a lot of stuff in there that DNN needs to work correctly). Or, maybe you copied the WCF web.config into a subdirectory of the DNN site? If so, you probably just want to merge those web.config settings with the main config.
The main issue that I've had with getting WCF to work in DNN is making sure that WCF is installed with IIS (so it correctly handles the .svc extension).