开发者

Viewing ASP.net Development Server from virtual machine

Microsoft recommends testing older versions of IE with the following virtual machines

This is all fine and good, except that the virtual machines can't see the Dev Server from Visual Studio. This makes it very difficult to develop or debug since I have to copy or deploy to IIS for every little change I make. I've tried using ARR, but it seems it can only forward to one开发者_运维问答 specific port at a time, whereas i need to have the port typed in the address bar of the virtual machine to match the port that it is connecting to on the host machine. Is this possible?


You shouldn't need to deploy to IIS to test changes.

We set our IIS up on development machines to point to the web project folder.

Once IIS is setup, you can add an existing website to your solution, select Local IIS and select the Site from the list of sites (rather than browsing the file system and selecting a .csproj file). You'll now have your site in VS that is hosted by IIS, ready to change and debug, and accessible from remote machines.


Generally speaking you cannot access the ASP.NET Development Server on one machine from another.

Here's some additonal notes on what you cannot do with ASP.NET Development Server from MSDN

  • ASP.NET Development Server 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 works only with individual pages and does not include the extra facilities of IIS. For example, the ASP.NET Development Server does not support an SMTP mail server. If your Web application involves sending e-mail messages, you must have access to the IIS SMPT virtual server to test e-mail because the ASP.NET Development Server cannot forward e-mail messages or invoke a server that does.

Anyway.....

Googling around I have found an article where somebody had success on accessing a Development Server remotely using a reverse proxy. I have not tried but here's the link

Configuring a Basic Reverse Proxy in Squid on Windows (Website Accelerator)

Also have a look at this StackOverflow question that has answers describing varous methods to achieve your results

Is There a Way to Make Remote Calls to ASP.NET Development Web Server?


You need to type the development server port into the address bar of the client browser, otherwise host the application in IIS and use the default port.

It is overkill to test with this number of configurations in the development environment. It is generally sufficient to test with 2 or 3 configurations while you are writing code (say IE8, FireFox) - just run these from the local machine (no need for a virtual machine). Once you've finished the UI, deploy your application to a test environment running IIS and test it against the larger range of configurations.

If you test each small change against all of these configurations as the change is made, you'll find yourself overwhelmed with testing. Don't forget that as well as the MS recommended test environments, various configurations of other browsers and operating systems (such as FireFox and Opera, Mac OS) are equally important - you may choose to only test a subset of these configurations depending on your resources.


I too found the link Lorenzo mentions in his comment, but had no luck with Squid configuration.

Happily there's a much easier method, as noted here.

  • Go to CNET and download SPI Port Forwarder
    • (Note: Click the "Direct Download Link" below the big green "Download Now" button. If you use the Download Now button CNET tries to install adware on your machine before giving you the file. It's very odd.)
  • In the first column, "Local Port" put the port you want people to connect to your machine on. I wanted people to come in on 80.
  • Second column, "Remote host", put "localhost" (it'll apparently port-forward to other machines).
  • Third column, "Remote port", put the port of the local webserver (in my case the ASP.NET Development Server on port 2485).
  • Click "Activate"

Hope this helps.


I am answering this old question to help peoples who wants to make it work without IIS. Thank you Fiddler !

1. First Step

You have to download Fiddler.

Once Fiddler is downloaded and installed, open it.

Go in Tools-> Fiddler Option-> Connection tab-> And check "Allow remote computers to connect" :

Viewing ASP.net Development Server from virtual machine

Restart Fiddler.

2. Second Step

After this, in the VM, open internet explorer-> Internet Options-> Connection Tab-> Lan Settings-> Check "Use a proxy server for your LAN" :

Viewing ASP.net Development Server from virtual machine

  1. The adress is the IP adress of your DEV machine.
  2. And put the port 8888

Now, you can access the ASP.NET Web Server from your VM !

To access it -> http://localhost.:54814

  • Don't forget the additional point after "localhost" !
  • The port, "54814" in my case, is the ASP.NET Web Server port.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜