What configs should be required to connect .aspx online? - c#

I'm pretty new learning c#, and ASP.NET. I want to connect the page I've written with visual studio2012 using IIS. I know how this works on local, but I don't have a clue about making this work online.
For example, when I debug my asp.net page, the directory is:
localhost:2791/WebForm1.aspx.
This project is saved on the IIS root directory, and all the configs for the IIS seems to be fine.
But when I try to access this such as, myip/WebForm1.aspx, it doesn't work.
What am I missing?

Firstly you need to host your web application in the IIS.
I am assuming that, you have correctly hosted your application in the IIS.
Now, try accessing it with address localhost:portnumber/virtual directory,
if you are able to access, then go ahead and read the answer below, otherwise, you simply have not hosted your app properly in IIS.
Now, to access your IIS hosted website through your IP address +Port number(if not default), you must check if Firewall has not blocked it.
For enabling access to your IIS hosted website through your IP, do this:
goto Control Panel\System and Security\Windows Firewall\Allowed Programs and make sure property World Wide Web Services (HTTP) is checked (for all the networks)

Related

ASP.NET website deploys but only I can see

I have a prototype .net web site that is on Windows 10, created using C#. I am using IIS on the same machine to deploy from Visual Studio 2017. It uses SQL Server for back-end data. The site only runs on intranet.
It deploys ok, I can see all the pages, from all three of my machines. But others cannot see anything. They get a run-time error, that does not say anything specific.
My machine was re-imaged and hence the need to redo this.
I looked at IIS log and it does not have any info. What else I can look into?
In web.config, turn off custom error mode to see detailed error message on the client:
How to set web.config file to show full error message
If it works locally and not remotely, it's likely a permissions error (accessing a resource that the client doesn't have access to), or maybe a pathing issue (you are referring somewhere to something by disk or UNC instead of URL, or to a domain that only makes sense to you, like localhost).

IIS Does not refresh changes on web references ASP.NET

I am working over a Virtual Machine using Microsoft Azure, and I installed an app into the IIS, however the when I want to replace the files I've transferred via FTP (From my Local computer to a VM folder) the IIS does not refresh the changes. These are the steps I've run:
Site -- Add new website
Fill up all the required fields
Start the app
but what I can see in the browser is old application, I tried to modified the code but the changes never displayed in the screen.
Note: it is a web service which I try to modified.
Note: I've tried, iisreset, stop the web site, re-start it, re-start the server, deleting the web site, re-create the web site but nothing works.
I am using 4.5.0 in my web app, in [Web.config].
Windows Server 2016.
IIS 10.
Is there something which I am doing incorrectly?
The issue was that there is something in VS2015 solution which does not allow to refresh the web service once the new files are updated via FTP. What I did was to install the https://learn.microsoft.com/en-us/visualstudio/debugger/remote-debugging-aspnet-on-a-remote-iis-7-5-computer and configure the Visual Studio to Deploy the web service to IIS in the Virtual Machine. This was the link which helped a lot.
https://learn.microsoft.com/en-us/aspnet/web-forms/overview/deployment/visual-studio-web-deployment/deploying-to-iis
RECOMMENDATION
DO NOT deploy a web site or service using FTP, it is better to set the ports in the VM and run the deployment from VS properly.
Check to be absolutely sure that you are overwriting the original files. I have seen some ftp clients show a very small status window that can make it easy to assume the files are transferring due to the flood of messages streaming by when in reality there are permissions issues preventing you from overwriting files. Expand the logging window for whatever client you're using so that you can confirm for certain that your files are actually transmitting. If they are, maybe you're dropping them in the wrong folder.

How to run set up mvc website on local

I've got a web application for our office use only. In my office I've got 12 computer and want to install one pc and access via web browser from all computers. I can run web application on visual studio but couldn't find a proper way for all computers and kinda new in this area.
I would like to access on browser like "myapp.com" or localhost something else. Is that possible to give specific name and access even on mobile phones?
Thanks in advance for all suggestions.
You can host your application using IIS. IIS can be setup in any machine.
Steps :
Install IIS
Open IIS manager by entering inetmgr in Run(win+R)
Add website by browisng to its location to the published website location. (Hope you know how to publish a website in visual studio)
Edit the web config file to configure the sql server credentials(Sql db could be hosted separately or in the same machine)
Right click the website in IIS Manager and click start.
Click browse to view the website
You could either access the site by localhost:portnumber or by specifying IP:port number in settings of the website in IIS manager
You can access the website from mobile or external devices if you select public IP for your website. Incase you're connected to a local network, then the website could be accessed only from within your work place. Discuss with your network admin about exposing your server to public by providing a public IP address, if you're on local network.
Feel free to revert if you have more doubts.

Web deploy "works" but some files not served

I have VS 2015 and a smallish C# web app. I can debug it on my desktop without issue. I have setup Web Deploy and have deployed the app to a dev server. The puzzling thing is that there are a couple of files that exist on the dev site that are not being served by the IIS server.
In my app I created a "LocalContent" folder at the same level as Views, Models, Scripts, etc with this structure
.../LocalContent/css
.../LocalContent/css/index.css
.../LocalContent/js
.../LocalContent/js/index.js
I can see the BuildAction property for the index.{css,js} files is set to Content and they do exist on the dev server.
When I load the dev site these resources both throw 403 errors (as seen through Chrome's Dev Tools). Not only that, looking at the URIs to these resources does not, for example, give .../LocalContent/css/index.css. Instead the dev-tools networking display shows something more like: .../LocalContent/css/?v=<long string of garble>.
This is my first IIS deployment so I am not sure what is or should be going on. Do I need to do something terribly Microsofty after each Publish event and restart the IIS process or reboot the IIS server machine?
These files are likely being served by IIS's static file handler, which acts as a different identity to your application pool.
Assuming your server is configured with defaults, granting the IUSR user access to your web root (or at least the specific directory)\ that contain the static files) should solve your problem.

Move a Web Site project with a web service to AWS windows server

I've started ut a new instance of a windows server 2008 and am trying to move and launch my web service I've created in Visual Studio. How do I move the project from my local computer to the remote desktop? Grateful for all help!
I've tried the really simple approach and just copied the directory to the remote desktop in the same location as on my local computer. Did not work.. When I try to access the same adress that it has on my local computer (http://localhost:80/somesite all I get is this:
HTTP Error 403.14 - Forbidden
The Web server is configured to not list the contents of this directory.
I'm probably going about this the wrong way, but don't know where to start..
Sounds like you need to setup IIS. See the following link http://www.codeproject.com/Articles/28693/Deploying-ASP-NET-Websites-on-IIS-7-0
I would make sure asp.net is enabled in the IIS server. Also try to explicitly hit your page such as:
http://localhost:80/somesite/myhome.aspx
I'm sure there is a quick answer to your particular issue, but if you're going to be doing this sort of thing often, it is best to take some time up front and read up, then click around and get a feel for IIS.
http://msdn.microsoft.com/en-us/library/ms178477.aspx
Visual Studio has abstracted much of the site/virtual directory setup and configuration, chances are you can't just copy the files over and have it work. There are lots of things to think about: websites versus virtual directories and their configurations, application pools and their identities, file permissions, default documents, etc. enjoy.

Categories