.NET web app published to Azure has no pages - c#

After publishing a web app without errors from Visual Studio 2019 to an Azure web app, the website 404s and I can see in the console that there are only DLLs and an EXE in wwwroot - no aspx or html files. There are some scripts and CSS files in wwwroot/wwwroot.
What am I missing? I'm new to C#.NET, so it's probably something fundamental, but I haven't found an answer yet.

What would be deployed depends on your project's file structure.
If your web app runs successfully, don't mind about the content in wwwroot. If not, make sure your project could run successfully local, then deploy follow this tutorial: Quickstart: Deploy an ASP.NET web app

It turns out that the web app will 404 on lots of types of errors, in this case a problem connecting to the database. I was able to figure it out using Diagnostic Tools and the application error logs, so would recommend anyone else having unexplained 404s to check the logs. Pretty basic stuff, but as I said this is all new to me.

Related

Blazor server side deployment http 500 error

i have a problem when i deploy my blazor app (self-contained or framework-dependent) to a private server.
App works properly on visual studio debug mode, i can process crud operations even on remote server.
However when i deploy the app, i get http 500 error and i cant find any additional information. None of the pages are opening.
I checked the _Host.cshtml and Startup.cs files. The app doesn't have complex pages or packages for now, only use asp net core identity with ef core.
Where should i look into first, what could you suggest?
https://i.stack.imgur.com/yN50q.png
Finally i find the solution.
When i deploy the app on azure, it says there is a error about mysqlconnector, and i delete ServerVersion.AutoDetect (Pomelo package), set the version by hand in Startup.cs and it works. But i don't know why it works.

Published .NET app is looking for API in source folder

I'm new to API development and have created a Web API app that works fine locally (Visual Studio / IIS Express). When I publish and deploy to IIS 8.5, the HTML pages work fine, but when I make an ajax call to my APIs, I get a 500 error. It somehow seems to be looking at my source code folder on my c: drive!, instead of the dll.
I'm guessing I botched something in the VS Publish setting, or in my API routing in WebApiConfig.
Any idea on why it's looking in my source directory?
From what I can understand, is that your API is expecting custom header as part of your request. Please use PostMan or any other REST API Client to test your API by adding required headers. If you build and publish in release mode you will not find your local source code folder path.

ASP.NET MVC Core Deployment via Visual Studio does not work

I am sorry to ask a question which doesn't have a specific problem, but I would be more than grateful if you could point the problem. (I can always provide other parts of my code which would be relevant to my question)
I am using Visual Studio to create my web application with ASP.NET MVC Core. All is good with the project and I can make it work on my localhost.
I bought a third party hosting service with Windows hosting (Plesk) and as far as I've asked them, they said their hosting plan supports ASP.NET Core.
For the deployment part, I've literally searched each and every source and tried various different methods but could not properly upload my files on ftp. Trying ASP.NET Core 1.0.0 version worked well and I uploaded a sample website, but since I am working with ASP.NET Core 1.1.0 now, I am unable to find a solution.
Here is what my publish profile looks like before hitting publish button:
I'm not really sure if I filled all the information correctly, but validation seems to work well.
And here is the log which I get after trying the publish via ftp method in visual studio:
Even though it seems to succeed, when I look at my ftp directory after this process, the files in visual studio project were never uploaded in the directory.
Any help is appreciated, thanks.
I have deploy the same on my server and it is working fine see the attached screenshot.

Why ASP.NET Project Gives HTTP Error 500 When Launched Through IIS 7

I'm writing an ASP.NET Web Forms project in Visual Studio 2013, but am having trouble moving it to my computer's IIS 7. Although the project launches successfully from Visual Studio and works properly, launching the version I put on IIS gives an HTTP 500 error: "localhost is currently unable to handle this request."
Here is my process:
Use the File System method of Visual Studio's Publish tool to publish the project to a folder on my computer.
Access IIS' Default Web Site, and set the Physical Path to the folder I published the application to.
If the project works from Visual Studio, why wouldn't it work in IIS?
I had a double entry for in my web.config, and it was causing the same issue: 500 error with no other clue.
The problem was I was submitting a Web Form Application instead of a regular Web Site. The former has additional files in it that makes it not work properly in IIS (at least, I've never been able to make it work).
Thankfully, making a blank Web Site in Visual Studio and copying the web pages over from the Web Forms application was a simple matter, and I got it working easily.
I had an entry made in the web.config
which caused this error...remove the line fixed this issue. so probably any error in web.config makes the browser to not load the server and hence the issue

How to Upload .Net Website to Hosting for it to work?

To learn more about .Net I created a website but now I want to learn how to Host it, in PHP I would just upload the files to the host and check everything how do I do this with a .Net website?
I have 2 Databases, Controllers, and Views.
I done some research and people said to just upload the files from the bin folder which I tried but it did not work, also tried just tried uploading the DLL files with no success.
Also tried uploading all the files from the project folder but it did not work.
Found a tutorial which right click the project and publish it so I tried publishing it to a folder and then uploading that but that did not work to.
To successfully publish and run your website on your host machine, the host machine must first have IIS (Microsoft's Internet Information Server) installed and running.
Once you have that in place there are several different approaches to deploy your website to the host. Here is a link to guidance from Microsoft's asp.net site in regards to "Choosing the Right Approach to Web Deployment".
Specifically, for you to be able to go "right click -> Publish" from within Visual Studio the relevant approach is "Web Deploy Handler (Publishing)" and you can find detailed instructions for setting it up in "Configuring a Web Server for Web Deploy Publishing (Web Deploy Handler)".
You just upload the files.
But you msut be sure that IIS is configured th acctually watch for a .NET app in the folder it loads in.
For normal we apps you did the right:
Also tried uploading all the files from the project folder but it did not work.
If it "just does not work" then it means .NET is just not there on that server or the folder you upload to is not configured to load a .NET project. Period. This is a fallback (technically you can upload less - the project file, i.e., is not needed), but it should work.

Categories