[Mono-aspnet-list] Create Web Site versus Web Application

Jeffrey Walton noloader at gmail.com
Wed Jan 27 10:07:34 EST 2010


Hi jmalcolm,

> I do not believe that MonoDevelop supports the Web Site
> metaphor for ASP.NET.
That's too bad. I was hoping to overcome a limitation [bug?] in Visual
Studio 2008 on x64Vista - IntPtr is the wrong size because the web
server hauled around by Visual Studio is x86. It is causing my calls
into the native APIs to fail.

> When you say the DLL "won't run" I am not sure what you
> mean though.
Agreed - a very bad description. Here's what I'm doing and seeing.

(1) Create a Web Application (taking defaults)
    - Default.aspx
    - Default.vb
(2) Press <F5> to build and run

Upon attempting to run, I receive the error, "could not connect to webserver".

(3) Project Options -> Run -> General
    - Check 'Run on external console'

No error. Console output is:

Adding applications '/:.'...
Registering application:
    Host:          any
    Port:          any
    Virtual path:  /
    Physical path: /home/jeffrey/Projects/Mono-Web-Test/Mono-Web-Test/
xsp2
Listening on address: 127.0.0.1
Root directory: /home/jeffrey/Projects/Mono-Web-Test/Mono-Web-Test
Listening on port: 8080 (non-secure)

Unfortunately, no web server is listening:

$ netstat -a | grep 8080
$

Indeed, I timeout when attempting to connect to http://127.0.0.1:8080
using Firefox.

Jeff

On Tue, Jan 26, 2010 at 3:08 AM, jmalcolm <malcolm.justin at gmail.com> wrote:
>
> I do not believe that MonoDevelop supports the Web Site metaphor for ASP.NET.
>
> I also recommend just using Web Application to build a website.  That is
> what I do and my projects run great.
>
> When you say the DLL "won't run" I am not sure what you mean though.  The
> DLL is the compiled code that will be called by your pages but you do not
> execute the DLL directly.  You should be trying to view your pages (for
> example you may have a files with names like index.aspx or Default.aspx) in
> a web browser.  These .aspx files will have @Page directive at the top that
> include a statement like Inherits that specifies what classes and methods
> from the DLL are available to that page.
>
> You interact with the pages, and the pages call upon the DLL.  You need a
> web server to serve the pages to your web browser.  On Linux, the Mono test
> web server is called XSP (or XSP2).  There is also a module (mod_mono) that
> allows the Apache web server to serve ASP.NET pages that will use Mono on
> the server.
>
> My apologies if I completely misunderstood your comment that the DLL "won't
> run".
>
> If you really, really want a Web Site structure there are some
> possibilities.
>
> If you already have a Web Site structure, Mono should run it just fine using
> either XSP or mod_mono on Apache as the web server.  The question is just
> how to author one and I am assuming that you do not want to create it all in
> gedit, vi, or emacs (although you could).
>
> At one point, in what seems like the distant past, I used Visual Web
> Developer, the free ASP.NET IDE from Microsoft, to connect remotely to files
> on a Linux box that was running Mono and Apache/mod_mono.
>
> I told Visual Web Developer (on Windows) to connect to the web site files
> via FTP and just used an open web browser to connect to the linux web server
> and test the files.  I did not use the built-in test web server provided by
> Visual Web Developer.  This solution requires two boxes of course: one
> Windows and one Linux but I remember thinking it was great at the time.  Any
> of the changes I made in Visual Web Developer would be immediately reflected
> on the Linux server each time I saved the files and I could see the results
> right away in my browser.  The Web Site itself was running on Mono.
>
> These days, you could use something like VirtualBox to run a copy of Windows
> in a virtual machine to run Visual Web Developer and connect back to the
> host Linux machine running Mono and the web server.  You would still need a
> Windows license but at least you would only need one box and Linux could be
> the OS running native on your hardware.
>
> Instead of a remote project, you could also just run Mono/XSP on Windows by
> running XSP on top of the local web site directory.  Just use a browser to
> connect to XSP instead of the web server Microsoft builds into Visual Web
> Develop and your app will be running on Mono.  This means using Windows
> exclusively though and you said you are running Ubuntu.
>
> One thing that some people confuse is the difference between using
> MonoDevelop and running "on Mono".
>
> If you are using XSP or Apache/mod_mono as your web server for development
> then your application is running on Mono regardless of what you use to
> author the web site.  You do not need to run MonoDevelop to create a Mono
> app.
>
> On Windows, you actually do not even have to have Mono installed to run
> MonoDevelop.  The stock Windows binaries available at monodevelop.com are
> built to run on MS.NET and not on Mono at all.  By default, the apps you
> build will also run on .NET although you can install Mono and tell
> MonoDevelop to use Mono instead of MS.NET for apps you write.
>
> One last thing, I do not believe that the VB compiler for Mono is of the
> same quality as the one for C#.  If you are not set on the language, you
> might consider using C# under Mono or compiling your code on .NET and just
> bringing the assemblies over to Mono.  I am sure the VB support is getting
> better and better though.
>
>
> [SNIP]


More information about the Mono-aspnet-list mailing list