Debugging ASP.NET MVC project in VS2010 and accessing on networked computers - visual-studio-2010

I'm wondering if it's possible to allow users on my local network to connect to an ASP.NET MVC 3 app I'm running through VS2010 on my local PC. The purpose is to let others test during some rapid application development without deploying to a server.
By default, the port seems to be blocked. Is there a setting in VS2010 or IIS Express that I can change to allow access to it?

By default VS sets localhost bindings in applicationhost.config file (%userprofile%\documents\iisexpress\config\applicationhost.config), so you cannot access it from other machines.
To access your site from other machines,
you need to update your site bindings (in applicationhost.config file) and add a site binding with your machinename
Run VS as administrator
If firewall is blocking your port, unblock it
Following link may help you
Configure IIS Express for external access to VS2010 project

Related

How work with a visual studio project in two different machines

In my home pc, I'm inside a LAN so my projects are access using localhost. In the WEB section of the project I use Local IIS
http://localhost/ProjectName
But in my office the pc belong to a domain so my IIS is bound to
http://myPc.myDomain.com/ProjectName
So how I can open the same Visual Studio solution on both PC?
First, on the home PC make an entry such as this in the local hosts file:
127.0.0.1 myPc.myDomain.com
Second, also at the home PC, configure the Website bindings in IIS, so when IIS receives a request for myPc.myDomain.com, it knows which website should process the request.

VS2013 hosting on existing azure virtual machine

When you start a New Project in VS 2013, you can choose to host the project on an Azure Virtual Machine.
The problem is that it seems you can ONLY CREATE a NEW ONE and not host it on an existing virtual machine you might already have.
Or at least, I cannot find the way to do so and cannot find anything on the net that shows me how.
QUESTION:
How can I use my existing Azure Virtual Machine to host an MVC application developed from my desktop??
If I understand what you're after, you can simply install and configure IIS, create a virtual and point it to the file system path where you have your production code (you can simply upload it to the server). You would then simply open up the appropriate ports in the Azure interface to allow external access if desired. You're basically just setting up an IIS site that can host your application then uploading the app to the server using something like FTP or web deployment.
-matt

How do I run (debug) WCF REST Service application on local IIS7 server

As the question says, I have a problem running the web app on local IIS.
Here is my situation:
WIndows over Oracle VM VirtualBox running on Linux Ubuntu.
Bridged Adapter so that Windows box gets local IP from my router.
Visual Studio 2010 + sp
WCF REST Service application plugin for project template
The application runs when using visual studio development server (on localhost).
Target framework is v4.0
What I need is that the application runs on IP instead on localhost (so I can consume it on remote computer in LAN), so I configured IIS7.
Here is IIS configuration:
I created a website with target framework v.4.0
I binded the site to my local IP on port 80
Path to the site is /inetpub/wwwroot iisstart.htm as default document
IIS runs ok. If I open "http://my_local_ip" I get the welcome logo.
The problem is in visual studio.
When I go to project properties "Web" section and select local IIS over vsd server is where I get lost. If I set "Project URL" to "http://my_local_ip/some_name" visual studio complains that it cannot find IIS server and so it was unable to create the virtual directory. I tried manually adding virtual directory in IIS manager, but no effect. If I use "http://localhost/some_name" as the "Project URL" the virtual directory gets created, but it makes no sense does it?
Could some one please enlighten me?
If I use "http://localhost/some_name" as the "Project URL" the virtual directory gets created, but it makes no sense does it?
I think you are mixing two different things here. When you ask VS to use localhost as the IIS Server for your project, it will connect to the local IIS to perform configuration tasks. If you ask VS to use "my_local_ip" you are telling VS that you IIS Server is remote, and therefore VS will use remote administration to configure IIS (VS can't know that my_local_ip is the local computer).
But remote IIS admin isn't enabled on a default WinServer box. Furthermore, it would require some additionnal network config. You should therefore tell vs to use the local server.
In fact, IIS site bindings and VS deployment parameters are too completely different things. So, deploy your site on http://localhost/your_site.
However, I don't really like the prospect of using VS debugging deploy to deploy a real app. The directory will contain all your project files... You should:
create your site on IIS manager and setup a virtual directory.
Either
ask VS to publish the site to a directory (your virtual directory)
ask VS to publish a WebDeploy package, then ask IIS manager to import the package.

Visual Studio is setting up my Azure web role to 127.255.0.0:82 instead of 127.0.0.1:80

I have Windows Azure SDK 1.6 installed along with Azure tools. I have one web role (with two endpoints, port 80 for http and port 443 for https) and only have one instance of the web role running (for testing purposes).
When I ran it from Visual Studio for debugging last week, it ran the emulator, attached it to IIS with a binding of 127.0.0.1:80 and everything was peachy.
But as of yesterday, as soon as I started it was trying to bind it to 127.255.0.1:82 and it stopped working with this error (from Visual Studio):
There was an error attaching the debugger to the iis worker process
for URL 'http://127.255.0.0:82'
Now if I manually go to IIS and change the bindings back, I can access the site through a browser but obviously I can't debug it via VS.
Why is Visual Studio doing this? What made it change from last week (I've only made code changes and I have commented them out)?
Edit: I know about this blog, but my issue seems to be different because for one reason I don't have errors in the event logs. And like I mentioned as soon as I change the bindings manually in IIS, I can access the site properly so the app pool is configured correctly.
Edit2: I have the following set:
<compilation debug="true" targetFramework="4.0" />
And my cloud project is set to startup project as well.
When I ran it from Visual Studio for debugging last week, it ran the
emulator, attached it to IIS with a binding of 127.0.0.1:80 and
everything was peachy.
I don't believe you ever debugged a Azure Emulator deployed project on 127.0.0.1:80 binding with IIS. There is a chance that what you've debugged is just the Web Application project and not the Azure Deployed one. Let me explain why:
Windows Azure Emulator uses internal emulated Load Balancer (LB).
This emulated LB binds to 127.0.0.1 port 80 (if port 80 is already
taken it uses port 81)
Windows Azure Tools are dynamically creating a virtual IP address
for every instance of a webrole you have. These dynamic IP Addresses
are 127.255.0.X, where X is the logical number of the instance (0,
1, 2, etc...).
Windows Azure tools creates a website in the local IIS, with binding
of 127.255.0.X and port 82
Step 3 is repeated for every instance you have defined.
When start debugging, your browser usually opens http: //127.0.0.1:81/ which is the address of the LB. But the request from this address is forwarded to the IIS and its binding to 127.255.0.X:82. You could not have debugged a Windows Azure Emulator deployed project by manually attaching debugger to 127.0.0.1:80, because, if everything was fine there is no w3wp process listening on that address:port, but Azure emulated LB.
When you only have the WebRole (no additional sites defined), Windows Azure Tools does know that it shall attach the debugger to 127.255.0.X:82 where a w3wp process is listening.
This is the clean working configuration of Azure Emulator & SDK & Tools v.1.6 (I think also 1.5 and even back to 1.3 where the Full IIS mode was introduced for first time)
Now if I manually go to IIS and change the bindings back, I can access
the site through a browser but obviously I can't debug it via VS.
Yes, you will be able to access the site, but in that way you are skipping the emulated LB, which is not the point when developing Windows Azure Applications.
If you are heving issues of that kind, I suggest that you clean your solution, restart the computer, and if the problem persist uninstall the SDK & Tools and perform clean full install of SDK & Authoring tols for Windows Azure v.1.6 using the Web Platform Installer.

How to make the webserver within Visual Studio serve content that’s viewable by other machines on the network?

How do I make the webserver within Visual Studio serve content that’s viewable by other machines on the network?
For example: When I press F5 and I give the other person the ip + port he/she can see the content.
Thanks!
You can setup Visual studio in order to use IIS to debug. Its in the properties.
If you do that then people can visit your debug.
http://learn.iis.net/page.aspx/387/using-visual-studio-2008-with-iis-7/
Sounds like it's not possible.
From MS Site:
If you cannot or do not want to use IIS as your Web server, you can still test your ASP.NET pages by using the ASP.NET Development Server. The ASP.NET Development Server, which is included with Visual Web Developer, is a Web server that runs locally on Windows operating systems, including Windows XP Home Edition. It is specifically built to serve, or run, ASP.NET Web pages under the local host scenario (browsing from the same computer as the Web server). In other words, the ASP.NET Development Server will serve pages to browser requests on the local computer. It will not serve pages to another computer. Additionally, it will not serve files that are outside of the application scope. The ASP.NET Development Server provides an efficient way to test pages locally before you publish the pages to a production server running IIS.
You could installl IIS or IIS express and publish to them, otherwise as Franky says its not possible with Cassini (the VS inbuilt one)

Resources