How do you publish an ASP.net MVC application from Visual Studio 2013 to your local network?

9.9k Views Asked by At

I made a simple ASP.net MVC web application in Visual Studio 2013, and I want to deploy it so it can be accessed from the browser on other computers on my local network. I have tried right-clicking my project > Publish (not sure what settings to use, Web Deploy, Web deploy package, File system, I published the website to my inetpub/wwwroot folder.

I managed to get IIS up an running, I've tried adding an application in the manager and editing the permissions to Everyone. I tried navigating to localhost/application_name but I was getting errors about not being configured to list the directory. I enabled directory browsing, but that just means it now shows a list of the files. How do I get it to actually run the app when I navigate to it in the browser? Am I close?

Edit: currently trying this http://johan.driessen.se/posts/Accessing-an-IIS-Express-site-from-a-remote-computer (although this I think is a step or two ahead of where I am) Also tried this: http://www.programmerfish.com/how-to-deploy-asp-net-web-application-on-the-network-in-windows-7/#.VGTLCvnF81L no luck so far

5

There are 5 best solutions below

0
On BEST ANSWER

The issue was that ASP.net was not registered with IIS

  1. Opened command prompt as administrator
  2. Navigated to C:\Windows\Microsoft.NET\Framework64\v4.0.30319
  3. Ran aspnet_regiis -iru

Now web app runs in IIS http://www.asp.net/web-forms/overview/deployment/configuring-server-environments-for-web-deployment/configuring-a-web-server-for-web-deploy-publishing-%28remote-agent%29

10
On

You can use IIS Express which comes with visual studio 2013. I've used this method to allow other members of the staff to access the website that is in my computer. Scott Hanselman has done a great post which I use every time when I want to expose a website hosted in local iis express to others in the same network.

http://www.hanselman.com/blog/WorkingWithSSLAtDevelopmentTimeIsEasierWithIISExpress.aspx

If you have any queries, let me know. Hope this helps

enter image description here

10
On

When I want to use IIS Express within Visual Studio for development, but allow local network users to see a version of my site, I tend to create a publish profile in VS that publishes to the local file system (e.g. C:\Publish\<yourwebsite>). Then from IIS Manager create a new website pointed to that same folder and it should be accessible to you via http://localhost and to network users via http://<your-pc-name> or http://<your-local-ip>.

You will need to add an exception to Windows Firewall to permit HTTP requests (i.e. port 80) through to your local machine, but if you have configured IIS correctly they should see the website.

It is possible to make IIS Express available to remote clients but that's not what it's designed for so really you're better off going down the IIS route since this will allow you to test the configuration as it would be on a live/production setting at the same time.

1
On

Check this, and old version of the same question. I'd bet you need to install IIS locally

Use Visual Studio web server in local network

7
On

You need to enable IIS on the host as IIS Express is not built with that in mind. Its for debugging purposes.

You've also not mentioned your binding configurations or your app pool settings.

Here is a comprehensive tutorial on how to publish your application using IIS IIS Video tutorial

You will need to ensure the binding that you specify is available across the network and that the connecting clients have permissions.