I have recently published my C# .net core Angular 2 web application to an IIS Server. However, the Web Api that I am calling is not working correctly. When I call the Api, a file is supposed to download however, the file does not render correctly.
I am sure that the api is being called as I am not getting a 404 error. When I run the project on my localhost, it works fine, but on the live site it is not working.
One more thing, when I enter information that should normally cause an error in the web api, it is not throwing me an error like it does in the localhost. It is as if the api is failing but when it is published to IIS it doesn't recognize the error in the angular observable. If anyone has any ideas on why this is happening or how I can debug this it would be appreciated. Thanks
Please run the WebApi from IIS individually and check the error.
Please check the file size while downloading because you need to
configure in webconfig file, if exceed default configuration.
Please check in Angular you have subscribe to that observable.
If you can give more details on this. It can help us to provide
more information like specific error and so on.....
Related
I just created basic Web API using Visual Studio 2022 > create new project > selected the C# ASP.NET Core Web API template. And it created the weatherforecast Web API and everything worked fine on my local system.
But when I deploy this to Azure Appservice, I get a 500 error. Any idea what's going on?
Usually, when we use Swagger, we will encounter a 404 error when publishing to Azure App Service. This is because swagger is used by default in development. But we have this problem and encountered a 500 error.
For 500 errors, we first look at the code and environment configuration issues at the project level.
It works well locally, there is a problem after publishing, there may be a problem with the parameters of some configuration files.
Once we have determined that there are no problems with the project files, we can only view the problem with the help of application insight and Diagnose and solve the problem.
Finally, you can only delete the current app service resource and recreate an app service with the same name for retesting.
I had a similar issue before, and we solved it by recreating the app service. Later, I also tried searching, and some people said that when creating an app service, you may encounter instances in some areas that are being maintained or updated, resulting in the created app service being in a bad state [The odds are very small].
I think this claim is credible because I once tried opening two Azure portal pages, one of which commits the operation to create the service and the other refreshes the page. In case of not creating successfully, we will see that another page can already see that the service created by the commit is in the resource group.
In short, trying to delete and recreate Azure App Service with confidence that there are no issues with our code is an effective means.
i deployed my class library to azure.
the api has a class library as a dependency, when i work locally with iis everything works.
the problam is when i deployed the api to azure, every call to the api thet makes the api use the class library fails (status code 500) , when i make a call to the api and it has nothing to do with the class library it works but for some resone i cant call the use the class library from the api in azure.
i have tried to set the copy local veribal to true but could not find where it is (if thet is relevent)
thenks in advence for your help!.
According to the MS DOC
Getting 500 internal server error
The app starts, but an error prevents the server from fulfilling the request.
This error occurs within the app's code during startup or while
creating a response. The response may contain no content, or the
response may appear as a 500 Internal Server Error in the browser.
The Application Event Log usually states that the app started
normally. From the server's perspective, that's correct. The app did
start, but it can't generate a valid response. Run the app at a
command prompt on the server or enable the ASP. NET Core Module stdout
log to troubleshoot the problem.
Please refer the links for more information On azure web APi show 500 internal server error , How to resolve error 500 on Azure web app | SO THREAD and 500 internal server error on web app| MS Q&A
I am trying to configure mono mod asp server for webapi. It's working fine with get method but Post method gives me strange error.
What I did is I simply created webapi default application and used its default apicontroller without any modification.
Get and Post api is working fine on IIS server. Tried to find the solution but got stuck very bad.
Please help me out.
I am having this strange problem:
I have just developed a WCF service (on VS2008) and created a website (ASP.net) to use that service. When I launch the website from VS2008, it works fine and I get the "You have created a service method", but if I try to open that service using IIS then it is not able to load the website at all. I get a message that "website found, waiting for reply", but the browser is not able to load the service at all.
Any help will be greatly appreciated!
There was problem with my IIS 7.5, in that ASP.NET was not registered for IIS. The following article was helpful: http://msdn.microsoft.com/en-us/library/k6h9cz8h.aspx
I used aspnet_"regiis -i" command and the websites started loading. Thanks for all the help guys!
A few troubleshooting items
Make sure in inetmgr under Web Services Extension that the required frameworks are unblocked.
Enable tracing to watch the messages
Enable exception details in faults
Make sure you are running the website under correct framework (under website properties)
In web.config, clear and add handler svc-Integrated-4.0
This is a similar question as IIS 7.5, Web Service and HTTP 405 error but a little different. Instead of a WCF web service, I've got an MVC2 web service that returns a 405 error when a PUT is used in the request. And, in my case, POST works just fine.
I'm guessing I need to either add or tweak an IIS 7 Handler Mapping to get PUT to work but my hosting provider hasn't been much help. Anyone out there run into this and know how to get PUTs to work in an MVC2 web service running in IIS 7? My apologies if this has already been answered, I've been searching all day and haven't found the magical answer.
Any help would be greatly appreciated...
We had the same problem, and the solution was adding an element into section in the Web.config file:
<remove name="WebDAVModule"/>
Have a look at https://serverfault.com/questions/93424/how-to-enable-put-and-delete-in-iis7/93428#93428
dario-solera:
You can take a look at the "Handlers
Mappings" sections at either the
server or site level (IIS group).
Select a mapping for an extension
(e.g. .aspx) and select "Edit" from
the context menu. The "Verbs" tab
allows you to specify verbs to accept.