Visual Studio 2010 / ASP.NET project / ASP.NET Development server
I can run and debug my VS2010 ASP.NET project from my development computer (where VS2010 runs). URL: http://localhost:port/MyApp.htm works fine.
Since I want to test the application from an IPad as well, I need to call the application with its IP address such as http://192.168.0.132:port/MyApp.htm
To my surprise this does not work, neither from the IPad, nor from the dev. computer itself. It is not a matter of connectivity, the address is correct / ping is possible.
(Note that I have no IIS installed on this machine, actually the ASP.NET application is plain HTML+JS, I use VS2010 just for debugging.)
Any workaround for this?
The Visual Studio Development Server will only serve pages to the local machine:
From Web Servers in Visual Web Developer:
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.
The ASP.NET Development Server only
accepts authenticated requests on the local computer. This requires
that the server can support NTLM or Basic authentication.
If you wish to test pages remotely you will need to use IIS or IIS Express.
I ran into this same problem and found a great solution. You can use SPI Port Forwarder (or a similar tool) to forward outside requests to the VS development web server. It works great and you can turn it on and off as needed.
Check out the info here:
Accessing the Visual Studio ASP.NET Development Server from iPhone & iPad
http://opensource.oxyva.nl/simple-development-proxy seems to work around Visual Studio Express 2012 for Web not allowing connections from other devices like iPhone, iPad etc. which result in "HTTP Error 400: Bad Request - Invalid Hostname"
There seems to be another solution as described in: visual web developer Web service on debug HTTP/1.1 400 Bad Request
You need to set up a WebSite in IIS, and deploy solution to virtual directory for the application to be accessible through an IP address outside of localhost(127.0.0.1)
Related
I have developed a ASP.Net MVC 4 application with Visual Web Developer Express 2010. It was successfully published/deployed to a remote server A (development server) using the Web Developer's built-in publishing tool and it works perfectly on it IIS 7.0 with the web deployment component.
Now I want to deploy it to another remote server B (production server). This one sits in an isolated environment and does not have Internet access! Even if server B is a replica of server A, its IIS 7.0 does not have the web deployment tool component installed. So the built-in publishing tool does not work for the web deployment option.
I then tried to publish it using the File System option. I copied the exported files to a new folder on IIS on server B. The folder was configured the same way as its counterpart on server A. I tried the URL on server B and it just gave me directory/files listing on the browser instead of the welcome page of the application.
Has anybody got the experience or tips to solve the issue? Thanks.
Cheers,
Alex
edit:
because it a MVC site, the default document doesn't apply. check the following steps:
IIS Extension Less URLs are enabled and allowed.
ASP.NET 4.0 is installed and registered. C:\Windows\Microsoft.NET\Framework\<version> and then aspnet_regiis -i (this will typically force IIS to use the MVC infrastructure instead of using the default document methodology)
Ensure App Pool is in 4.0 Integrated mode.
Ensue that the IIS Advanced Settings for the website are showing the right root folder path.
I need to show customer an ASP.NET MVC3 website, but they don't have IIS or Visual Studio installed. only .NET Framework 4 is installed.
So my question is: Is there any tiny little IIS server (like IIS Express), but don't require installation, that can run the compiled site just on local machine?
PS: I don't need advanced features. But HttpHanlders and HttpModules should be working fine.
I back Shan's suggestion to host your website on a server somewhere and access it over the Internet. I don't see why it wouldn't work for Intranet applications either unless you have dependencies on some services like SMB shares or network printers.
The Cassini ASP.NET webserver is portable and doesn't require installation, but it doesn't run the same as IIS and there are things that will break (because it invokes ASP.NET for every request unlike IIS, so if you've blocked unauthenticated visitors then they wouldn't be able to download site images and stylesheets, for example, until they've logged in).
I am trying to deploy a server that I can hit from a different computer in my office. I only need one, two computers to hit it max. I am using Visual Studios Express 2012 RC for Web and have the whole website made, but I can't figure out how to actually deploy it. When I click play to debug it (after I have told it to build the web site) it brings it up on my computer that I built the server on but I can't hit it from another computer. The address it gives me on the browser is localhost:XXXXX. I know local host means that computers IP and I have tried that repeatedly. I am stumped. Please help. I thank you for any help you give in advance. Also if you need more information please feel free to ask.
You can't run it from Visual Studio Express, you have to deploy the web application to an IIS server. You can't access the site if VS is not running, because it creates a local, specialized development server when you start the application, whether with debugging or not. You need to configure IIS on your web server. What is the OS? Once you go through a tutorial to set it up, you will copy your code to an application folder that will be created for you. The details vary by IIS version.
Internet Information Services (IIS) – formerly called Internet
Information Server – is a web server application and set of feature
extension modules created by Microsoft for use with Microsoft Windows.
IIS 7.5 supports HTTP, HTTPS, FTP, FTPS, SMTP and NNTP. It is an
integral part of the Windows Server family of products, as well as
certain editions of Windows XP, Windows Vista and Windows 7. IIS is
not turned on by default when Windows is installed. The IIS Manager is
accessed through the Microsoft Management Console or Administrative
Tools in the Control Panel.
http://en.wikipedia.org/wiki/Internet_Information_Services
http://www.iis.net/
As per my understanding Visual Studio has a default Deployment Server for ASP.net sites, what should be done if i need to access this site on intranet.
I created a web site in Visual Studio 2010 using asp.net and vb this works fine on localhost but if another friend of mine tries to access it from his pc (he is in the same netwrk) he gets access denied error.
Queries -
should there be a external server whr i should host this site
which is bttr IIS or apache or mono or something....
is there any other way pf remotely accessing this site
You have two options.
Set up IIS on your computer. http://www.youtube.com/watch?v=vBNoTK31zPo
You can set up a virtual directory that points to your project folder.
Use a proxy if you don't want to or can't set up IIS. Remote machines cannot connect to Visual Studio web server
My asp.net web app is hosted on this URL on my local machine:
http://localhost:45433/
I want to access the same application from a different computer on the network. I tried replacing the localhost with my IP but it did not work.
any ideas!
UPDATE 1:
Now, I am getting this error:
Login failed for user ''. The user is not associated with a trusted SQL Server connection.
If your application is hosted using Visual Studio's built in web development server then this server does not allow remote connections. It is for testing purposes only and accepts connections only from localhost. In order to access your application from remote clients you might need to deploy it to IIS.
First, add the application as a virtual in IIS, and as long as you can access the machine on the network, you can do:
http://<machine name>/<virtual>
I do that at work, where I can access my co-worker's web site.
HTH.
That looks a lot like a url used by the development web server in visual studio. That web server only responds to requests from the localhost. It won't work for other requests from other machines on your network.
You need to install IIS on your machine (must be a Pro version of Windows) and deploy to that IIS install to share your app on the network.
I don't think the built-in version of Cassini (VS debug server) allows remote connections.
However, the UltiDev version, built off of the same code base with a few enhancements, does, and is a much lighter-weight install than IIS (especially if you can't find your OS install DVD). It also integrates nicely with Visual Studio for debugging purposes.