publish .net mvc to a remote windows server - c#

I am facing a problem publishing an mvc webapi to a remote server. Currently i have deployed the website to the server and am I able to run the site in the windows server browser as a localhost however when i try to access it over the internet thought the public ip address i get a 404 error of file not found.
The port is open. i'm using iis 7.0 and windows server 2008.
I have checked all the bindings to the port! I tried to check if mvc is installed and all I read says that mvc comes already with iis 7 and webplatform installer says that .net 4.5.1 is installed
Any ideas how to solve this?

Just some simple ideas of how to resolve it. Hope they are usefull.
a) Check the app pool of the application. Set it to the correct .NET framework if required.
b) A very simple test I perform to see if its the app or the url.
- Stop the app.
- Place your app in a folder temporarily.
- Place a simple index.html HTML file where your app should be.
- Browse to it and see if 404 shows.
c) if its a new box and not set correctly you might need to set up IIS for Application Development. Check this Link with regards to setting it up. Expand the tree to make sure you select what you need.

Related

The Application is configured to use IIS (Visual Studio 2017/2019)

**Hi Guys I just Cloned my project from a repository.
I am getting this Similar error
The Web Application Project […] is configured to use IIS. The Web server […] could not be found.
I do have IIS Manager on my pc. one of the solution is to set True on my cs.proj file but when i do it auto imports a port number. when i try to run the application with that port number the application hangs(load forever).
What are possible ways to solve this error ?**
Just to register an answer for all getting into the same problem under the same scenario, as we discuss and resolve it from the question's comments:
Ps: as i said this solution works for this particular scenario, maybe anyone else has to apply a different approach!
In this case, try to follow the below link for other solutions!
The Web Application Project [...] is configured to use IIS. The Web server [...] could not be found.
Reset the IIS; (https://learn.microsoft.com/en-us/visualstudio/debugger/error-the-web-server-is-not-configured-correctly?view=vs-2019)
Publish the project;
Add it to IIS Server;
Run it using IIS Local (not the IIS Express)

How can I run an mvc app on windows server?

I'm really new at this, never hosted an app before, everything I've done so far has been locally.
I have a windows server 2008 sp1 running at work, with IIS installed. I access to it via remote desktop, and I need to be able to deploy my app, first locally on the server, so computers that can access it (through LAN) are able to use it.
Right now, if I create a folder and put some data in it, with an html file, and go to "localhost" in a browser, I can see the rendered html file.
The version installed is IIS 7.0, and my app is uses the MVC pattern, and .net framework 4.6.
If on my windows 10 PC I start my app (vs 2017) I can see it on my browser.
I want to be able to do what I do in my PC but on the server. How can I do this?
Update:
I tried Publishing the app through vs but that is on my windows pc and getting a lot of errors. What I know so far is that a guy from Networks gets the app by the developers and they publish it, but I don't know what kind of files does he need.
I followed tutorials but I just can't apply them.
As I said earlier, I have visual studio installed on my w10 PC, and tried publishing through that app to the ip where the server is, getting a lot of errors.
I don't know what to do, I'm really trying a lot of different things, but I don't even know how the app is supposed to look to be run in any way that is not how I run it in visual studio.
UPDATE:
I'm getting this error when I try to publish locally
Here is the Outline of what we need as per OPs requirement
In VS publish the App to a folder
Sort out the server prerequisites:
Turning Windows Feature On or Off for ASP.NET, ISAPI filters, ISAPI extensions, NET extensibility
Server should have .NetFramework installed
Copy the published folder to the Server
Configure IIS manager to add a new site and set physical path to published folder

Allow others to view local IIS7 ASP web application

I'm working on a Visual Studio 2012 web application, and need to allow colleagues to view the current website by my IP address (while I would access it my localhost). It appears that hosting the site locally through IIS7 and allowing others to access it by my local IP the simplest method. After troubleshooting and experimenting for a day though, I still don't understand the relationship between an IIS7 site/website/application and Visual Studio web application, and the MSDN explanations are really hard to follow.
Basically, I'm trying to understand:
1) How to set up a IIS website and application (should the 'physical path' be the VS solution folder or deployment package .zip folder?, for example)
2) How to most simply deploy the web application (e.g. File System/ Web Deploy/ Web Package, etc.) and
3) The order to do all of this.
I'm running VS as administrator, my port 80 is open, and have IIS7 set to use .NET v4, yet when I publish the selection using File System in VS2012 to my C drive, the resulting site gets a HTTP:500 error, with no source code underneath. (Also, before even publishing, setting the solution to use my Local IIS instead of IIS Express and previewing results in a blank page). If there is a better way to do this please let me know.
Thanks in advance.
If you don't want to learn (or bother) with the details of setting it up, you can use a small utility like 'ngrok' that will allow others to view your website at 'localhost'.
Takes about 5 minutes to learn and get up and running (and its free).
https://ngrok.com/

C# ASP.NET can not reload web application

i can not reload the WebApplication project, i got this message error
i moved the server to another place, so the IP is changed.
i already change the ip on IIS and WebApp config
i already uninstall IIS and reinstall
i already use aspnet_reggis -i
but still i, can not reload the WebApplication.
thanks you in advance
PS: i m sure is because the IP configuration. it work well at my home, now i bring the computer to office...it not work anymore....nothing change just the IP my home is not the same like IP in my office
the error message says: the project web ESPTEMPS_WebApp is configured for IIS, the website is not found.
You most likely need to configure your IIS for your website.
here's a helpful link to do this: http://msdn.microsoft.com/en-us/library/cek8kw6e.aspx
Good luck,
Your application is configured to work with IIS, in your case, IIS is not installed in your system or maybe the developer used IIS Express when developing. (You need to install VS 2010 sp1 to get IIS Express 7.5 integration with VS)
What you can do is:
Close your solution and open the csproj file in notepad (of the project that is giving problems)
Find and set these values:
<UseIIS>False</UseIIS>
<UseIISExpress>False</UseIISExpress>
Then reopen your solution again with visual studio. You will be able to debug with the web developer web server.
I found a very good reference for you. It will walk your through set of steps to help you configure your IIS. Here is the link. Please ignore the steps that are not applicable to you. But basic idea is:
Open Project Properties and go to Web tab
Select local IIS web server. If it is already selected, it will show you a virtual directory. If it doesn't already show selected, then mention the virtual directory.

After copying my asp.net website I get 500 and 404 errors? [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Database Deployment issues
I followed the steps in this video:
http://www.asp.net/iis/videos/developing-and-deploying-in-a-shared-hosting
I just open my website on VS2010. then use the copy tool and I create a new directory and copy my web application into this new dir. the copy is done successfully but when I try to access it I get 500 for the main page which contain only some static menus and when I try to access any of my other pages it gives me a 404 error!
I tried to add some sections to my web.config to handle the errors and show me what's exactly wrong as advised before but It won't give me any details! .. also when I try to remotely access my IIS I can only see the folder of my application but I can't see any files! and the icon for my application is a normal folder, I've seen some screenshots of an IIS of a deployed website and the folder icon is converted to an application icon.
I've also tried to click on my application in IIS a right click > Deploy > Convert To Application. but it generates "An Error occurred when the request was processed on the remote computer. the server experienced an issue processing the request"!
I've been trying to deploy my website for 3 days and posted three questions with no results! :S
Problem Solved
I've tried to speak to my provider again today and an agent advised me that I need to have my application on a virtual path to deploy it as an application. and it worked.
But I marked Chris's answer as the correct one not because it's the only answer but has really stated some good points and I really appreciate his help.
Thank you so much guys :)
Well.. 404 means file not found. 404's won't be caught by the .net runtime, unless it's for a file with a regular .net extension like .aspx. 500 is an internal server error.
Things I would investigate
Can you deploy just a regular HTML file and load it?
if this works, move to #2. If not then either you aren't pointed to the right machine or you aren't deploying your files to the correct location.
Can you deploy a very simple (nearly blank and self contained) .aspx file and load it? If this works, then .Net is installed. If not, then you need to figure that out.
Can you look at the file system to see if anything is actually there? If you aren't seeing it, then it didn't get deployed.
Is the appropriate version of the .Net framework installed on the remote computer?
Basically, if your app is a .Net 4.0 app, then you need the 4.0 framework installed on the machine.
Is the app pool correctly configured for the correct .net framework version?
Regardless of whether the correct version of the .net framework is installed, you still have to configure the website to use the right version of the .net framework.
Some helpful hints. Don't deploy to c:\inetpub\wwwroot. wwwroot is a directory for the default IIS website and is usually not configured correctly. Just create another directory like c:\inetpub\myapp and deploy there. Also, make sure you disable the default website in IIS and create a new site (not a virtual directory) and point it to the correct location.
I suspect that either you aren't deploying to the correct location and/or your iis settings are bad.
Somewhere along the way on the above you ought to figure it out.

Categories