66435 members! Sign up to stay informed.

Sponsored Links


Resources

.NET Research Library
Get .NET related white papers, case studies and webcasts

News News News Messages: 11 Messages: 11 Messages: 11 Printer friendly Printer friendly Printer friendly Post reply Post reply Post reply XML XML XML

Deploy .NET Applications on Linux with Grasshopper and Mono

Posted by: Paul Ballard on May 25, 2005 DIGG
Mainsoft and the Mono Project have joined forces to enable .NET developers to extend their application deployment to Linux environments. The product, called Grasshopper allows ASP.NET, ASMX Web Services, and other server based applications to be compiled to Java bytecode and executed in a J2EE server running on Linux.
Grasshopper allows .NET developers to extend their skills to the J2EE and Linux markets. – Yaacov Cohen, CEO, Mainsoft.
The product consists of three primary parts. The first is a Visual Studio Add-in that makes new project types available such as “C# for J2EE”. These projects have the necessary references and templates for creating applications intended to be deployed both in .NET and J2EE.

The second piece is the Mono Open Source .NET Framework. Mono is being developed to provide a .NET CLI implementation on Linux and other Unix based operating systems. Currently they have most of the .NET 1.1 Framework class libraries re-implemented including ASP.NET, ADO.NET, and will have a version of System.Windows.Forms out sometime around September. The Mono ASP.NET and ADO.NET classes are used to develop applications intended to be deployed on multiple OSs.

The third piece is the Mainsoft Binary compiler. This compiler takes the IL produced by the C# compiler and converts it to compiled Java bytecode for use in the J2EE environment. The output can be deployed directly to a Linux or Unix based server.

A .NET application written to be deployed within J2EE can also make use of Java EJBs by adding a reference to the EJB from Visual Studio. The Mainsoft add-in then creates a managed wrapper for the EJB so that the .NET developer can work with the bean as if it were a .NET component.

Mainsoft has done quite a bit of work to ease the process of allowing developers to deploy applications in both environments including creating an installation package that will allow you to run Linux inside Windows using a virtual machine running Debian GNU/Linux. The installation also includes the PostgreSQL database and Apache Tomcat web server.

In speaking with Miguel De Icaza, the leader of the Mono project about their integration with Mainsoft’s Visual MainWin product, he said
“This is a big step in terms of unification, this is the first time that we have achieved a shared code base”.
I took the opportunity to talk to Miguel about the Mono project in general. Mono is the 7th largest open source project in the world right now, behind other notable efforts such as Linux, Mozilla, and OpenOffice.org. When asked about negative feedback about Mono creating a dependency on Microsoft he said:
In any open source project you’re sure to get every possible opinion. But [based on the size and popularity of Mono] I don’t see adoption as being a problem”
Developer who download and use Mainsoft’s Grasshopper product will also be able to contribute to the development of Mono directly by either posting it to the Mainsoft developer site or to the Mono project site.

Download Mainsoft Grasshopper

Threaded replies

·  Deploy .NET Applications on Linux with Grasshopper and Mono by Paul Ballard on Wed May 25 13:11:26 EDT 2005
  ·  Deploy .NET Applications on Linux with Grasshopper and Mono by bob farmer on Wed May 25 19:21:50 EDT 2005
    ·  Stack Tracing by Laurence Moroney on Wed May 25 22:25:53 EDT 2005
      ·  Stack Tracing by Marty Farrell on Thu May 26 07:52:27 EDT 2005
      ·  pretty cool by peter lin on Thu May 26 09:18:02 EDT 2005
      ·  Stack Tracing by bob farmer on Fri May 27 11:03:41 EDT 2005
    ·  Microsoft namespaces by bob farmer on Fri May 27 13:41:17 EDT 2005
      ·  Microsoft namespaces by Stephen Bloch on Sun May 29 04:49:37 EDT 2005
  ·  Deploy .NET Applications on Linux with Grasshopper and Mono by Carlos Adolfo Ortiz Quiros on Thu May 26 09:13:49 EDT 2005
    ·  Deploy .NET Applications on Linux with Grasshopper and Mono by Srikanth Remani on Thu May 26 11:42:50 EDT 2005
  ·  The good thing about deploying on tomcat by peter lin on Fri May 27 11:54:08 EDT 2005
    ·  The good thing about deploying on tomcat by Tero Vaananen on Mon May 30 09:57:35 EDT 2005
  Message #171935 Post reply Post reply Post reply Go to top Go to top Go to top

Deploy .NET Applications on Linux with Grasshopper and Mono

Posted by: bob farmer on May 25, 2005 in response to Message #171898
In such a environment, how does a tech support person or developer who receives a stack trace from an application deployed on a j2ee server/linux trace back to the original code written in say c#? Is there some sort of mapping file generated when translating the .net code to java (like in an obfuscation scenario)?

  Message #171945 Post reply Post reply Post reply Go to top Go to top Go to top

Stack Tracing

Posted by: Laurence Moroney on May 25, 2005 in response to Message #171935
That's an excellent question.

I have played with it by debugging the java applications that are running on my development box, and the debugging is seamless, but, I never thought about a production scenario, where I don't have direct debug access to the machine and what kind of stack trace I would get. So, I took one of the Grasshopper samples from their site and deliberately put a divide by zero error into it.

Here's the stacktrace I got:

java.lang.ArithmeticException: / by zero
at LinuxWebClient.QuoteList.Button1_Click(quotelist.aspx.cs:122)
at LinuxWebClient.QuoteList.__Accessor__0x00000001(quotelist.aspx.cs)
at LinuxWebClient.QuoteList$__Impl2.Invoke(Unknown Source)
at system.Web.UI.WebControls.Button.OnClick(Button.cs:159)
at system.Web.UI.WebControls.Button.System_Web_UI_IPostBackEventHandler_RaisePostBackEvent(Button.cs:179)
at system.Web.UI.WebControls.Button.RaisePostBackEvent(Button.cs)
at system.Web.UI.Page.RaisePostBackEvent(Page.cs:837)
at system.Web.UI.Page.RaisePostBackEvents(Page.cs:800)
at system.Web.UI.Page.InternalProcessRequest(Page.cs:749)
at system.Web.UI.Page.ProcessRequest(Page.cs:707)
at system.Web.HttpApplication$ExecuteHandlerState.Execute(HttpApplication.cs:442)
at system.Web.HttpApplication$StateMachine.ExecuteState(HttpApplication.cs:733)
at system.Web.HttpApplication$StateMachine.ExecuteNext(HttpApplication.cs:688)
at system.Web.HttpApplication$StateMachine.Start(HttpApplication.cs:640)
at system.Web.HttpApplication.System_Web_IHttpAsyncHandler_BeginProcessRequest(HttpApplication.cs:1137)
at system.Web.HttpApplication.BeginProcessRequest(HttpApplication.cs)
at system.Web.HttpRuntime.InternalExecuteRequest(HttpRuntime.cs:328)
at system.Web.HttpRuntime.ProcessRequest(HttpRuntime.cs:374)
at system.Web.GH.BaseHttpServlet.service(BaseHttpServlet.cs:99)
at GhHttpServlet.service(GhHttpServlet.cs:18)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:534)


Mighty Useful, huh?

Laurence

  Message #171977 Post reply Post reply Post reply Go to top Go to top Go to top

Stack Tracing

Posted by: Marty Farrell on May 26, 2005 in response to Message #171945
That's quite cool actually, a clear Java exception type indicator in a .NET code behind click event. I would have expected some vague 'an error occurred' message as the runtime exploded.

  Message #171986 Post reply Post reply Post reply Go to top Go to top Go to top

Deploy .NET Applications on Linux with Grasshopper and Mono

Posted by: Carlos Adolfo Ortiz Quiros on May 26, 2005 in response to Message #171898
This is a clear intention that J2EE is stronger. Why .NET is not as native to Linux environments? I think Microsoft will never make a .NET version for the Linux or Unix environments as it will be against its own Windows market. How useful is to have a .NET environment being executed by JVM and not CLR? What use is this partnership and besides Mono will always be back than Microsoft real .NET framework because when they finish version 1.1 the 2.0 for .NET is out and also they cannot implement the full framework as Microsoft does not want it to be but Microsoft likes .NET being made by others but not them as such guarantees .NET is used everywhere, who knows what will happen.

  Message #171987 Post reply Post reply Post reply Go to top Go to top Go to top

pretty cool

Posted by: peter lin on May 26, 2005 in response to Message #171945
That's an excellent question.I have played with it by debugging the java applications that are running on my development box, and the debugging is seamless, but, I never thought about a production scenario, where I don't have direct debug access to the machine and what kind of stack trace I would get. So, I took one of the Grasshopper samples from their site and deliberately put a divide by zero error into it.Here's the stacktrace I got:java.lang.ArithmeticException: / by zero at LinuxWebClient.QuoteList.Button1_Click(quotelist.aspx.cs:122) at LinuxWebClient.QuoteList.__Accessor__0x00000001(quotelist.aspx.cs) at LinuxWebClient.QuoteList$__Impl2.Invoke(Unknown Source) at system.Web.UI.WebControls.Button.OnClick(Button.cs:159) .........
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683) at java.lang.Thread.run(Thread.java:534)Mighty Useful, huh?

Laurence

looking at the stacktrace, I have to say it's pretty neat. It looks like they've ported over parts of .NET so that it's easy to cross compile to java. In a way, it's like the reverse of IKVM.

peter

  Message #172001 Post reply Post reply Post reply Go to top Go to top Go to top

Deploy .NET Applications on Linux with Grasshopper and Mono

Posted by: Srikanth Remani on May 26, 2005 in response to Message #171986
This is a clear intention that J2EE is stronger. Why .NET is not as native to Linux environments? I think Microsoft will never make a .NET version for the Linux or Unix environments as it will be against its own Windows market. How useful is to have a .NET environment being executed by JVM and not CLR? What use is this partnership and besides Mono will always be back than Microsoft real .NET framework because when they finish version 1.1 the 2.0 for .NET is out and also they cannot implement the full framework as Microsoft does not want it to be but Microsoft likes .NET being made by others but not them as such guarantees .NET is used everywhere, who knows what will happen.

There is IKVM, which runs Java on CLR, does that make .Net superior ? Mono is one of the least credited projects in Open Source world, which is despised just because it does not follow the dogma of the OS-religious maniacs. Come on, version lag exists in Java world (should i say more). This is one more rant against .net/mono. I will spend my money on .net/mono and hey, not every one needs to run their software everywhere :)

  Message #172102 Post reply Post reply Post reply Go to top Go to top Go to top

Stack Tracing

Posted by: bob farmer on May 27, 2005 in response to Message #171945
Thanks Laurence. That is indeed a very detailed stacktrace.

Which btw shows how you can actually bring the best of two worlds together ... develop in ASP.Net and deploy in a servlet container, where you can do additional stuff like servlet filters, which to me still is a much better and more flexible interception mechanism than the http modules/handler mechanism in asp.net.

Very neat!

  Message #172109 Post reply Post reply Post reply Go to top Go to top Go to top

The good thing about deploying on tomcat

Posted by: peter lin on May 27, 2005 in response to Message #171898
The one good thing about deploying on tomcat is that it's easier to see how many active threads and connections there are.

On a semi-related note. Does anyone know why the ASP.NET performance counters for active threads doesn't return the real number of active threads? I came across this in 2003 and have been guessing why those performance counters aren't really implemented.

peter

  Message #172122 Post reply Post reply Post reply Go to top Go to top Go to top

Microsoft namespaces

Posted by: bob farmer on May 27, 2005 in response to Message #171935
Does anyone know how Grasshopper will handle the case when you are using the Microsoft.* namespaces like Win32 or CSharp? Does it fail when it is compiled to Java bytecode?

  Message #172202 Post reply Post reply Post reply Go to top Go to top Go to top

Microsoft namespaces

Posted by: Stephen Bloch on May 29, 2005 in response to Message #172122
Does anyone know how Grasshopper will handle the case when you are using the Microsoft.* namespaces like Win32 or CSharp? Does it fail when it is compiled to Java bytecode?

I think those API's are not supported by Mainsoft.

Read this article from mainsoft dev site

http://dev.mainsoft.com/Default.aspx?tabid=47

They explain how the unsupported API will be handled during
the compilation.

  Message #172273 Post reply Post reply Post reply Go to top Go to top Go to top

The good thing about deploying on tomcat

Posted by: Tero Vaananen on May 30, 2005 in response to Message #172109
Does anyone know why the ASP.NET performance counters for active threads doesn't return the real number of active threads? I came across this in 2003 and have been guessing why those performance counters aren't really implemented.peter

While I was investigating a memory leak problem in my software, I was trying to make sense of all these counters. I do not have a link for you, but I was reading that a majority of all these counters are buggy and not to be trusted.

 
New content on TheServerSide.NETNew content on TheServerSide.NETNew content on TheServerSide.NET

DSLs and language interop

Language "mashups" will become more prominent, and developers will become polyglots, one programmer suggests.

VS 2008 Resources

SearchWinDevelopment.com offers an introduction to the language, performance, testing and data management improvements in VS 2008.

VB code downloads home

VBCode.com code snippets cover all aspects of application development, from data binding to security to the user interface.

XAML Learning Guide

Get up to date on XAML best practices with a variety of articles, tutorials and webcasts. [SearchWinDevelopment.com]

Company uses VSTS DB edition to tame workflow

One team's experience with the VSTS DB edition suggests that it can improve workflow for dev teams. It also enhanced Agile efforts. (June 24, Article)

Book: Intro to DSL Tools

Microsoft has begun to include DSL tools in the VSTS kit. A new book by Steve Cook and other VSTS team members helps set the stage. (June 24, Article)

I See the Silverlight Shining!

Cartoon: Be it ever so humble there is no place like your home after you get a Microsoft Home Server . (June 18, Cartoon)

A look at .NET 3.5

Microsoft's Thom Robbins says new technology to highlight in NET 3.5 includes AJAX, LINQ for both C# and VB, as well as tooling enhancements intended to ease the task of building WPF, WF and WCF apps. (June 29, Podcast)

Venkat Subramaniam on AJAX

Venkat Subramaniam discusses AJAX bottlenecks, the tenets of Agile development and more. He spoke at the Ajax Experience. (June 25, Tech Talk)

Building a Claims-Based Security Model in WCF - Part 2

In the second of a two-part series, Michele Leroux Bustamente discusses design decisions related to the claims-based security model. Read the story and walk through the process for creating a set of claims-based utilities to encapsulate claims authorization at the service tier. (May 24, Article)

Introducing the Entity Framework

Understanding why the Entity Framework exists and learning where it can fit into your projects can get you prepared for the eventual release early next year. (May 10, Article)

WCF Security Learning Guide

Resource: This learning guide gives you quick access to useful links on Windows Communication Foundation security information. (April 24, Article)

Brad Abrams: Patterns for successful ASP.NET AJAX development

TSS.NET's Jack Vaughan spoke recently spoke with Microsoft's Brad Abrams to find out what he is seeing in the field and what the chefs in Redmond are cooking. Along the way he discusses patterns of AJAX frameworks. (April 11, Article)

Building a Claims-Based Security Model in WCF

In a two-part series, Michele Leroux Bustamente explains how claims-based security is supported by WCF, and how you can implement a claims-based security model for your services. (March 29, Article)

Authoring workflow using XAML

Windows Workflow Foundation is a new technology that many developers will need to get their heads around. In a brief excerpt adapted from Programming Windows Workflow Foundation: Practical WF Techniques and Examples using XAML and C#, K.Scott Allen considers aspects of workflow definition. (March 22, Chapter Excerpt)

News | Blogs | Discussions | Tech talks | Patterns | Reviews | White Papers | Downloads | Articles | Media kit | About
All Content Copyright ©2007 TheServerSide Privacy Policy
Site Map