Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27226

VS 2010 Embedded Web Server that supports ASP.Net 4

$
0
0
Hello guys,

I am trying to make a asp.net app easier to use for my client; Currently I have him download Abyss Web Server and configure it, however that is causing him headaches. I am now looking into a Embedded Web Server.


I have read I can use Mono's Web Server that will run off of .NET versus the Mono platform if on windows; And I tried to use it, however I can't get anywhere special.

ASPNetServe looks great, but it appears it only uses .NET 2-3.x, and unfortunately the controls i use will not allow me to downgrade from 4 to 3.5. I keep receiving not declared messages.


While using Mono.WebServer, I am using the following code:

VB Code:
  1. Imports System.Net
  2. Imports Mono.WebServer
  3.  
  4. Public Class myserv
  5.     Dim port As Integer = 80
  6.     Dim path As String = "E:\Clients\Chuck\Website\Photoviewer\Photoviewer\"
  7.     Dim websource As XSPWebSource = New XSPWebSource(IPAddress.Any, port)
  8.     Dim WebAppServer As ApplicationServer = New Mono.WebServer.ApplicationServer(websource)
  9.  
  10.     Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  11.  
  12.  
  13.         'Dim cmdLine As String = port & ":/:" & path
  14.  
  15.         WebAppServer.AddApplication(vbNull, 80, "/", path)
  16.         'websource.SetListenAddress(80)
  17.         WebAppServer.Start(True)
  18.  
  19.         MsgBox("Servers Started")
  20.     End Sub
  21.  
  22.     Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
  23.         WebAppServer.Stop()
  24.         MsgBox("Servers Stopped")
  25.     End Sub
  26.  
  27.     Private Sub myserv_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  28.  
  29.     End Sub
  30. End Class


The server starts up, however when I try to visit http://localhost/ it just hangs. Nothing gets returned to the browser.



Any help or recommendations of me using a easily controlled standalone, or some form of embedded web server would be fantastic. Thanks.

Viewing all articles
Browse latest Browse all 27226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>