upfromthesky.com

And there it was....

MVC Lovers can now run their apps on Linux and Apache!  The release 2.4.2 of the Mono platform from Novell is now able to run ASP.NET MVC applications with this release.  

I am very impressed with the rate of progresss with this group, especially for being an OSS project.  Very ineteresting stuff.  There is also some P/Invoke interoperability via a new tool called M/Invoke.  Be sure to check it out!  

 

Here are the release notes from http://www.mono-project.com/Release_Notes_Mono_2.4.2

Mono 2.4.2 is a portable and open source implementation of the .NET framework for Unix, Windows, MacOS and other operating systems.

Major Highlights

Mono 2.4.2 is a bugfix release for Mono 2.4, which is the foundation for Novell's own long-term support Mono-based product.

In addition to bug fixes, this release includes the following major changes from 2.4.0:

  • We now ship Microsoft's ASP.NET MVC stack and ASP.NET MVC applications can run with Mono.
  • xbuild has been updated
  • Removed non-free amqp0-8.xml documentation.

Changes in Mono 2.4

XSP now has Silverlight mime types registered.

Updated the browser database.

The C# Shell (csharp) will now accept C# scripts specified on the command line, like:

$ csharp demo.cs

A major bug was fixed for multi-threaded applications using XPath, if you are using XPath in a multithreaded application, we strongly recommend that you upgrade to this version.

 

 

Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList

Strong Naming an Assembly

Strong naming is very helpful when you are trying to run asp.net applications under the Medium Trust settings imposed by organizations and most Shared Host ISPs.  I found a great blog post on this process, I've listed it below:

 

Great article on strong naming an assembly here

Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList

I'm sure there are many blog articles out there, but I'd figure I'd add another post.  Mostly fo rmyself to refer to, but also for anyone else stumbling on the issue.  In the code I'm about to post there are some objects that are used in the main method of which the code I won't display... however, you can pretty much tell what I'm sort of doing within the code to "Matlock" it out.  

Once I figured out how easy it was to do without a 3rd party add-on and how  it was mentioned that with thousands of products the regex matching would be slower and that it was recommended that I create may have to create my own provider plug-in for the third party tools (which is unnecessary and adding to the complexity) I decided it would be easiest and fastest to "roll my own."   It's rather simple and it uses regex as well, but  only a single match is required per request...  Here is my sample code below: 

using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Web; 
using System.Web.UI; 
using System.Text.RegularExpressions; 

namespace Producs.Rewrite 

    /// <summary> 
    /// URL ReWrite Rules for the Products 
    /// </summary> 
    public class ProductRewrite : IHttpModule 
    { 
        HttpContext context; 
        public ProductRewrite() 
        { 

        } 

        #region IHttpModule Members 

        public void Dispose() 
        { 
            //nothing to dispose 
        } 

        public void Init(HttpApplication context) 
        { 
            context.BeginRequest += new EventHandler 
(context_BeginRequest); 
        } 

        #endregion 

        private void context_BeginRequest(object sender, EventArgs e) 
        { 
            context = HttpContext.Current; 
            Regex regex = new Regex("^(.*)/Products/(.*)\\.aspx$", 
RegexOptions.IgnoreCase); 
            Regex productPageRule = new Regex("^(.*)/Products/ 
product.aspx(\\?)?(d=(.*))?$", RegexOptions.IgnoreCase); 
            Regex ProductsListPage = new Regex("^(.*)/Products/ 
Products.aspx(\\?(.*))?"); 
            string url = context.Request.RawUrl + 
(context.Request.QueryString == null ? "" : 
context.Request.QueryString.ToString()); 
            if(productPageRule.IsMatch(url)) 
                return;  // do nothing if the request is a direct 
request to the product.aspx?d= page. 

            if (regex.IsMatch(url) && (!ProductsListPage.IsMatch 
(url))) 
            { 
                try 
                { 
                    if (HttpContext.Current.Cache["ListOfAllProducts"] 
== null) 
                    { 
                        HttpContext.Current.Cache.Insert 
("ListOfAllProducts", Common.LoadProducts(), null 
                            , DateTime.Now.AddMinutes(5), 
System.Web.Caching.Cache.NoSlidingExpiration); 
                    } 
                    Akdproduct product = ((List<Akdproduct>) 
HttpContext.Current.Cache["ListOfAllProducts"]) 
                        .Find(d => d.Slug == GetPageName 
(context.Request.RawUrl).Replace(".aspx", "")); 
                    url = url.Replace(product.Slug + ".aspx", 
"product.aspx?d=" + product.ID); 
                    context.RewritePath(url); 
                } 
                catch (Exception ex) 
                { 
                    Common.LogException(ex); 
                    context.Response.Redirect("~/error404.aspx"); 
                } 
            } 
        } 

        private string GetPageName(string url) 
        { 
            if(url.Trim() == string.Empty) 
                return string.Empty; 
            string[] split = url.Split('/'); 
            string pagename = split[split.Length - 1]; 
            return pagename; 
        } 

    } 

 



This is an HTTP module so you will need to make the application aware of that it's there by adding an entry into the web.config => System.Web  => HttpModules section... 

 

Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList

PhotoStream

TextBox

RecentPosts

Calendar

<<  August 2010  >>
MoTuWeThFrSaSu
2627282930311
2345678
9101112131415
16171819202122
23242526272829
303112345

View posts in large calendar

Control panel


Blogroll


Archive