ASP NET MVC 6 Web App hosted on Azure not running - asp.net-core

I have a MVC 6 application which is hosted in Azure as web app. It is running fine on local by iisexpress but when I hosted it in Azure using publish option in Visual Studio, it is not working. It is just waiting to load website. After 4-5 minutes wait, it displays nothing.
I also tested it with static file. I uploaded a static html file in wwwroot folder but it is also not working.
I am not getting how can I see the actual error. Anybody can help me?

Since you've provided almost no information I gonna have to guess, since I had a similar error this weekend when deploying an ASP.NET Core 1.0 WebApp to an Azure App Service.
The issue I was facing was, that the main application wouldn't start. After a couple of hours trying to figure it out I got an error message with the method mentioned in the comments (running web.cmd manually) which returned an Microsoft.AspNet.Server.Kestrel.Networking.UvException: Error -4089 EAFNOSUPPORT address family not supported exception.
I couldn't find anything directly related to it, but was a hint about an IPv6 problem. A few other SO posts hinted that setting http://*:12345 as port binds to both, IPv4 and IPv6. So after I changed the url to http://0.0.0.0:12345 in the hosting.json, it started without issues.
I filled an issue on Kestrel GitHub and this seems to be a bug in Kestrel.
Edit: In response to the comment:
I used to have
{
"server": "Microsoft.AspNet.Server.Kestrel",
"server.urls": "http://*:8081"
}
and changed it to
{
"server": "Microsoft.AspNet.Server.Kestrel",
"server.urls": "http://0.0.0.0:8081"
}
The difference seems to be that http://*:8081 also binds to both IPv4 and IPv6 on the same port, whereas http://0.0.0.0:8081 only binds on IPv4 and not on IPv6.

Related

Publish .NET Code application to Arvixe Host

I have a ASP.NET Core with Blazor website and I want to deploy it to Arvixe host. The website is very simple and contains only UI elements no database required. I published the website to a local file system and uploaded it using FTP to the Plesk.
When I am visiting the website, I receive this error:
500 - Internal server error. There is a problem with the resource you
are looking for, and it cannot be displayed.
I have tried to run it on the IIS and I received more details:
Configuration The configuration file cannot be read due to
insufficient permissions.
I tried to add IIS_IUSRS to the group and users for web.config but I am not able to find it because I am using a windows 10 connected to active directory.
Besides, I still don't know how to solve this problem at Arvixe. Does anyone know tips might help?
500 internal error is generic issue. Please kindly check the error message on the server and paste it here. Make sure that your provider has installed .net core bundled on their server and here are tutorial about publsih .net core using plesk https://windowswebhostingreview.com/how-to-publish-using-web-deploy-with-plesk-control-panel/. It should be working fine.
You need to give Full Trust permission (Read-Write-Execute) to your application folder and also to Application Pool and also check if the Runtime version supported by Arvixe matches with your Asp.net Core version.
Also enable the logs in web.config file by setting stdoutLogEnabled="true" to get detailed error so that you can investigate more about the error.

Persits ASPPDF ImportFromUrl ServerXMLHTTP Error: The request has timed out

We have a test website that uses Persits ASPPDF to build a PDF using the ImportFromUrl method. It works fine on our test domain, but when I use the same code on another domain (and crucially perhaps, a sub-domain) I get the "MSXML2::ServerXMLHTTP Error: The request has timed out." error.
This leads me to think its related to the problem outlined in
https://support.persits.com/show.asp?code=PS080709171
"the calling Active Server Page (ASP) should not send requests to an ASP in the same virtual directory or to another virtual directory in the same pool or process. This can result in poor performance due to thread starvation."
So perhaps the config of the two servers hosting the two sites (test and live) are different - and if so what would that be? - Or you can't run this method on a sub-domain? Any guidance out there please?
I've had the same issue for weeks and finally found out what the problem was. In my case, it was because I had set to True the options that allow the debug of classic ASP code, without which I could not debug using visual studio. Setting those options back to False fixed the issue.

ASP.NET Core web app response with 502 error

I'm investigating an issue with the asp.net core 1.1 web app.
We had to install the latest VS 2017 on the build server. And straight after that, all the deployed builds return 502 responses. Nothing changed in the app code or the referenced packages, however, many binaries are different after VS 2017 install. The deployment is done via FTP.
I also noticed there is now a small difference in Http response headers. API Response Headers used to have Server: Kestrel. But now, after installing VS2017, the deployed builds return Server: Microsoft-IIS/10.0. This probably explains 502 error, but why would the Server now switch to IIS?
Managed to fix it. The error is caused because IIS server (proxy) can't access AspNetCoreModule, the process that hosts kestrel. Usually, the reason is because kestrel in some trouble.
The solution starts with checking Application logs in Event Viewer on the server.
In my case it was:
Application 'MACHINE/WEBROOT/APPHOST/MyApp.API' with physical root '\servername\c$\inetpub\wwwroot\MyApp.Api\' failed to start process with commandline '"dotnet" .\MyApp.Api.Web.dll', ErrorCode = '0x80004005 : 80008083.
So, by googling the error code I've realised that the server didn't have the right asp.net core version (for some reason).
Downloaded the installer, works fine now! :)

setting "server name" when using kestrel with dotnet core

I am writing an app using asp.net mvc that right now runs against microsoft's kestrel server. It works fine, and I pass values to it at startup using a hosting.json file defined as follows;
{
"server": "Microsoft.AspNet.Server.Kestrel",
"server.urls": "http://localhost:5000;https://localhost:5001"
}
Is there any way to give the "server" a name, so that it isn't always reporting as localhost or undefined all the time?
Please replace localhost with *. This will give the below benefits:
If you give localhost, you can access the application only through http://localhost:5000 and not using IP [http://192.168.1.2:5000, an example]. By using *, you can access through the IP.
You can connect to the server from other PCs or Mobile Devices.
A few days back, I had the same requirements as yours and got the solution from: docs.asp.net. [The Comments section is hidden by default. Please click Show Comments and search for localhost.]
Tip 1: To view the application from a mobile device, please check: Viewing localhost website from mobile device.
Tip 2: My question and answer has been posted here: Compiling an ASP.NET 5 Web Application and generating DLL files.

WCF wsdualhttpbinding strange behaviour at client side that has no clear (Exception details)

to make long story as short as possible, I made a duplex WCF service, using wsdualhttpbinding, tested it on my local machine using Visual Stuido and using IIS7, thigs are working fine (i had to use windows authentication on IIS7 to make it work thu). Any way, I published the duplex service on my company network (LAN network, windows domain, IIS 6) which i used to for many WCF services (basic and ws http bindings and worked fine) and the problem is I can not get the service to work, I tried all possible configurations to the app.config and to the web.config files, still i can not make it work.. The problem is when the client start calling the duplex service It hangs and no error message or whatsoever, and after few minutes it gives me a timeout error.. there is no error at server side ( i have checked the even viewer). There is not error about port 80 or access privileges. Is there anything i am missing? anything i should take care of and i forgot? i have been awake for 20 hours trying to find a solution because i have a time line to follow or my boss will Dispose() Me..
i have tried the following:
1- I set the IsOneWay = true..
2- I run the program as admin.
3- I i set the base address to another port.. same result..
4- I used windows auth, none... same result..
5- i have tried another machine to test the client.. same result.. it hangs with no reponse.
6- I also tried running the client on windows vista, 7 and xp... same result..
7- I have played with all kind of configurations in config files and i made sure its the same on both files (app.config and web.config)..
8- I have added a static constructor in the service side to see if the service was ever reached by the client, i added few lines to add a value in the db.. and nothing was written to db.. so it was never reached..
9- Yes, when i access the service SVC page i see the page and it worked fine.. I could access the metadata as well..
10- restarting the server, restarting IIS server, Recycling AppPool...etc..
I tried all of that and many other solutions and tricks.. same result when the app is on IIS.. the strange thing is, there is no error at server side.. and i only get TimeOut error (if i get it).. While If i tried the service on the IIS installed locally it works fine.. change the config file to point to the company IIS server,,, no luck!
Is there anything i am missing??? could be something simple but i just missed it..