<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://townx.org" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>townx - Getting ASP.Net (C#) running on Linux, using Mono and xsp2 - Comments</title>
 <link>http://townx.org/blog/elliot/getting-asp-net-c-running-linux-using-mono-and-xsp2</link>
 <description>Comments for &quot;Getting ASP.Net (C#) running on Linux, using Mono and xsp2&quot;</description>
 <language>en</language>
<item>
 <title>Sorry, I also should have</title>
 <link>http://townx.org/blog/elliot/getting-asp-net-c-running-linux-using-mono-and-xsp2#comment-38509</link>
 <description>&lt;p&gt;Sorry, I also should have said what I didn&#039;t like about MonoDevelop. I think it was that it was giving me little over what I could get from a decent text editor, as I didn&#039;t seem to be getting code completion. Also, I couldn&#039;t find a specific &lt;span class=&quot;caps&quot;&gt;ASP.N&lt;/span&gt;et project type (I think my experience was with an old version of MonoDevelop, as at the time I was using the distro package, and I&#039;m on an old Ubuntu: hence I upgraded using the binary installer). I think I should give a more recent version a go before I comment in more depth, as I&#039;m sure things have moved on. Also, I know Eclipse pretty well, so my personal preference would be to use a plugin, if such a thing exists.&lt;/p&gt;</description>
 <pubDate>Sun, 05 Oct 2008 15:19:00 -0500</pubDate>
 <dc:creator>elliot</dc:creator>
 <guid isPermaLink="false">comment 38509 at http://townx.org</guid>
</item>
<item>
 <title>Michael, thanks for the</title>
 <link>http://townx.org/blog/elliot/getting-asp-net-c-running-linux-using-mono-and-xsp2#comment-38508</link>
 <description>&lt;p&gt;Michael, thanks for the great comment. Extremely helpful. I think you&#039;re right: I get a few odd error messages occasionally from apps. about Mono libraries being in the wrong place (I removed Mono altogether and installed into a local directory instead), so I guess the binary installer has wrecked something. And when I try to run monodevelop from the directory I installed into, I get an error where it tries to connect to /usr/lib/monodevelop/bin (which doesn&#039;t exist). So I&#039;ll probably try the instructions you mentioned instead, to get a clean install.&lt;/p&gt;

&lt;p&gt;Sounds like the version of 2.0 will be far more useful, and I&#039;ll definitely keep an eye on your blog for release announcements etc.. Good work on it so far: I&#039;m certainly enjoying learning it.&lt;/p&gt;</description>
 <pubDate>Sun, 05 Oct 2008 15:17:14 -0500</pubDate>
 <dc:creator>elliot</dc:creator>
 <guid isPermaLink="false">comment 38508 at http://townx.org</guid>
</item>
<item>
 <title>I&#039;d be interested to know...</title>
 <link>http://townx.org/blog/elliot/getting-asp-net-c-running-linux-using-mono-and-xsp2#comment-38504</link>
 <description>&lt;p&gt;As the author of &lt;span class=&quot;caps&quot;&gt;ASP.NET &lt;/span&gt;support in MonoDevelop, I&#039;d be interested to know what problems you had so that I can fix and improve things. If you could contact me/us by email, the mailing list or &lt;span class=&quot;caps&quot;&gt;IRC &lt;/span&gt;that would be great :-)&lt;/p&gt;

&lt;p&gt;I&#039;ve worked on &lt;span class=&quot;caps&quot;&gt;MD&#039;&lt;/span&gt;s &lt;span class=&quot;caps&quot;&gt;ASP.NET &lt;/span&gt;support quite a lot since the 1.0 release -- the upcoming 2.0 release will even have code completion for &lt;span class=&quot;caps&quot;&gt;ASP.NET, &lt;/span&gt;and outlining, folding, etc. -- but the fundamentals have not changed much since 1.0. The &lt;a href=&quot;http://monodevelop.com/Creating_ASP.NET_Projects&quot;&gt;MonoDevelop &lt;span class=&quot;caps&quot;&gt;ASP.NET &lt;/span&gt;tutorial&lt;/a&gt; explains a few things.&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;BTW, &lt;/span&gt;the cross-distro binary installer has been discontinued due to &lt;a href=&quot;http://mjhutchinson.com/journal/2007/11/08/how_not_break_mono&quot;&gt;various subtle problems&lt;/a&gt; (mainly caused by people installing it to /usr and partially overwriting distro packages), so I&#039;m glad it seems to have worked out for you.&lt;/p&gt;</description>
 <pubDate>Thu, 02 Oct 2008 23:56:13 -0500</pubDate>
 <dc:creator>Michael Hutchinson</dc:creator>
 <guid isPermaLink="false">comment 38504 at http://townx.org</guid>
</item>
<item>
 <title>Getting ASP.Net (C#) running on Linux, using Mono and xsp2</title>
 <link>http://townx.org/blog/elliot/getting-asp-net-c-running-linux-using-mono-and-xsp2</link>
 <description>&lt;p&gt;I&#039;m going to keep this brief, but hopefully explain how to get &lt;a href=&quot;http://www.ASP.Net/&quot;&gt;ASP.Net&lt;/a&gt; to work on a Linux machine. Your best choice here is to use &lt;a href=&quot;http://www.mono-project.com/&quot;&gt;Mono&lt;/a&gt;, which implements most of the important bits of ASP.Net (in fact, probably all of them, but don&#039;t quote me). So for starters, here&#039;s how to get a simple ASP.Net page up and running under Linux. (Note that I didn&#039;t enjoy the MonoDevelop experience much, and didn&#039;t find a decent C# plugin for Eclipse, so I&#039;ll be writing code direct for now.)&lt;/p&gt;

&lt;p&gt;First off, you&#039;re going to need Mono itself. The download site is at &lt;a href=&quot;http://www.go-mono.com/mono-downloads/download.html&quot;&gt;http://www.go-mono.com/mono-downloads/download.html&lt;/a&gt;. However, there aren&#039;t any official package for Ubuntu there, so I tried &lt;a href=&quot;http://www.mono-project.com/Other_Downloads&quot;&gt;http://www.mono-project.com/Other_Downloads&lt;/a&gt; instead. If you can find a package for your distribution, that may well work.&lt;/p&gt;

&lt;p&gt;I struggled to compile the source for Ubuntu and couldn&#039;t get the debs to work (I&#039;ve got an old version of Ubuntu), before I noticed there&#039;s a cross-platform Linux installer which worked fine for me. However, &lt;a href=&quot;http://mjhutchinson.com/&quot;&gt;Michael Hutchinson&lt;/a&gt; mentioned in a comment below that &lt;a href=&quot;http://mjhutchinson.com/journal/2007/11/08/how_not_break_mono&quot;&gt;this isn&#039;t such a good idea&lt;/a&gt;; his blog entry links to &lt;a href=&quot;http://www.mono-project.com/Parallel_Mono_Environments&quot;&gt;another set of installation instructions&lt;/a&gt; I didn&#039;t manage to find on the Mono site, which look promising. I&#039;ll try those next time.&lt;/p&gt;

&lt;p&gt;Here&#039;s the link in case you want to try it:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://ftp.novell.com/pub/mono/archive/1.9.1/linux-installer/2/mono-1.9.1_2-installer.bin&quot;&gt;http://ftp.novell.com/pub/mono/archive/1.9.1/linux-installer/2/mono-1.9.1_2-installer.bin&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From a terminal, make it executable and run it:&lt;/p&gt;

&lt;pre&gt;
chmod +x mono-1.9.1_2-installer.bin
./mono-1.9.1_2-installer.bin
&lt;/pre&gt;

&lt;p&gt;This starts up the graphical installer. Follow the prompts to get it on your system. I recommend putting it into a directory out of the way of the standard Linux directory structure: I installed it into a directory within my home directory.&lt;/p&gt;

&lt;p&gt;Next, create a directory for your project and put a basic ASP.Net page into that directory, so you can test that the Mono compiler&#039;s working properly. Create a file called index.aspx with this content:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;%@ Page Language=&quot;C#&quot; %&amp;gt;&lt;br/&gt;
&amp;lt;html&amp;gt;&lt;br/&gt;
&amp;lt;head&amp;gt;&lt;br/&gt;
&amp;lt;script runat=&quot;server&quot;&amp;gt;&lt;br/&gt;
private void Submit(Object sender, EventArgs e) {&lt;br/&gt;
&amp;nbsp;&amp;nbsp;button1.Text = &quot;You clicked me!&quot;;&lt;br/&gt;
}&lt;br/&gt;
&amp;lt;/script&amp;gt;&lt;br/&gt;
&amp;lt;/head&amp;gt;&lt;br/&gt;
&amp;lt;body&amp;gt;&lt;br/&gt;
&lt;br/&gt;
&amp;lt;h1&amp;gt;ASP.Net on Mono&amp;lt;/h1&amp;gt;&lt;br/&gt;
&amp;lt;form runat=&quot;server&quot;&amp;gt;&lt;br/&gt;
&amp;lt;asp:Button id=&quot;button1&quot; Text=&quot;Click me!&quot; runat=&quot;server&quot; OnClick=&quot;Submit&quot;/&amp;gt;&lt;br/&gt;
&amp;lt;/form&amp;gt;&lt;br/&gt;
&lt;br/&gt;
&amp;lt;/body&amp;gt;&lt;br/&gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;I took this from the &lt;a href=&quot;http://www.w3schools.com/ASPNET/aspnet_controls.asp&quot;&gt;W3Schools tutorial on ASP.Net&lt;/a&gt; and modified it for C#.&lt;/p&gt;

&lt;p&gt;To run your page, get a command line up and connect to your project&#039;s directory. Then run the embedded server &lt;code&gt;xsp2&lt;/code&gt; (bundled in the Mono installer), to start your application in its own web server:&lt;/p&gt;

&lt;pre&gt;
xsp2 --port 9192
&lt;/pre&gt;

&lt;p&gt;To see your site running, visit &lt;a href=&quot;http://localhost:9192/&quot;&gt;http://localhost:9192/&lt;/a&gt; in a web browser. You should see a clickable button whose text changes when you click it.&lt;/p&gt;

&lt;p&gt;That&#039;s enough for one night. Next time, where to put your code-behind pages, and perhaps how to get MySQL working with Mono.&lt;/p&gt;</description>
 <comments>http://townx.org/blog/elliot/getting-asp-net-c-running-linux-using-mono-and-xsp2#comments</comments>
 <category domain="http://townx.org/tech">tech</category>
 <pubDate>Thu, 02 Oct 2008 16:08:07 -0500</pubDate>
 <dc:creator>elliot</dc:creator>
 <guid isPermaLink="false">747 at http://townx.org</guid>
</item>
</channel>
</rss>
