Click here to Skip to main content
15,892,537 members
Articles / Web Development / ASP.NET
Article

A conversion of the popular DotNetNuke web application to C#

Rate me:
Please Sign up or sign in to vote.
4.16/5 (23 votes)
11 May 20072 min read 184.7K   69   62
In an attempt to open DotNetNuke to a wider audience, I have converted the original VB code into C#

Introduction

DotNetNuke is an open source web application framework ideal for creating, deploying and managing interactive web, intranet and extranet sites. It is very well supported; just take a look at Snow Covered. Unfortunately, VB and C# programmers don't cooperate as best they should, and take a mutually exclusive choice between the languages. This is unfortunate because DotNetNuke is a very well developed framework for ASP.NET that a lot of C# programmers do not want to look at.

Purpose

In an attempt to open DotNetNuke to a wider audience, I have converted the original VB code into C#. On Oct. 28, 2006 I released the first successful build in C#. Today, Jan 2, I have fixed most of the bugs and have a decent workable copy of DNN in C#.

Lessons Learned

Throughout the course of translating the code I learned many lessons. At first guess, you might think that translating the VB code would be easy, as did I. It wasn't more than ten minutes into this project that I learned otherwise. First, I attempted to translate the code using VB Conversions and compiled the resultant source code with over 3,000 errors. This obviously wasn't going to work out. Second, I tried to use Lutz Roeder's Reflector to look at the code from the compiled binary. Although this resulted in slightly better results, it wasn't a viable solution. If I was ever to complete this in time to be deemed useful I needed an alternative route. Finally I came up with a solution that was a combination of the first two methods, and some specialized tools I made specifically for this project to get it done.

Results

As a result of converting the code, the new C# version runs incredibly much faster than its VB cousin. I was also able to increase its speed by compiling and generating a single named assembly for all pages + classes in the website. This wasn't that easy due to ASP.NET not allowing App_GlobalResources in pre-compiled websites, but I was able to get around this bug by embedding the GlobalResources and SharedResources into the DotNetNuke.Library library, and using a ResourceLoader to extract the strings from the embedded resources in the assembly. The remaining config files were then placed into the config directory.

Conclusion

I converted this project to make it more readable by myself and other C# programmers and open the DotNetNuke to a larger audience.

Google Code

The project is hosted on Google Code. Please visit Project's Google Code website for the latest bug fixes and releases.

Important Links

  • This is the project home at Google code.
  • This is the SVN repository.

News

Jan. 5, 2007: New bug fixes, modules all load during install, user registration works, and most obvious bugs have been fixed.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer myspace
United States United States
Its a passion, why else would we be doing this? Everyday it feels like gold fever, wouldn't you agree? With the boom of the internet and an ever decreasing world, programming today feels a lot like the wild wild west of the past. Its so wide open, filled with tremendous opportunities. Its more than a passion, its a forming of the ideas that later generations will use.

With over ten years experience, I've earned the right to say that. The majority of my career has focused on enterprise application development. I earned my BS in CS from UCI, hi everybody. My fondest memories as a child was working with the 8mhz IBM AT my daddy brought home for us. Yeah, I'm a geek, and proud of it. We're at the forefront of something huge, enjoy it.

Comments and Discussions

 
GeneralRe: What a complete and utter waste of time and effort Pin
dde17-May-07 7:25
dde17-May-07 7:25 
GeneralRe: What a complete and utter waste of time and effort Pin
jonavi25-May-07 4:06
jonavi25-May-07 4:06 
GeneralRe: What a complete and utter waste of time and effort Pin
emission6-Aug-08 11:59
emission6-Aug-08 11:59 
GeneralRe: What a complete and utter waste of time and effort Pin
Jeffrey Scott Flesher6-Aug-08 14:32
Jeffrey Scott Flesher6-Aug-08 14:32 
GeneralRe: What a complete and utter waste of time and effort Pin
emission7-Aug-08 2:15
emission7-Aug-08 2:15 
GeneralRe: What a complete and utter waste of time and effort [modified] Pin
Jeffrey Scott Flesher7-Aug-08 5:52
Jeffrey Scott Flesher7-Aug-08 5:52 
AnswerRe: What a complete and utter waste of time and effort Pin
JakeSays17-May-07 14:34
JakeSays17-May-07 14:34 
GeneralRe: What a complete and utter waste of time and effort Pin
RGTSS26-Oct-07 20:06
RGTSS26-Oct-07 20:06 
While I am not quite C# savvy I am both VB and C++ savvy as well as Java.

I wouldnt call this a "complete waste of time" nor would I call it "the way it should be... aka C#".

First, with the advent of 2.0's MSIL, CLR etc, if anyone knows anyone in the know at MS they will readily tell you that:

1. VB is essentially now a kind of shelled C#. This is what PO'd many a VB 6 coder, the transition of VB from where it was to where it is. VB was considered the choice for RAD in business as of VB 5/6. Gobs, heaping gobs of businesses used it as well as VBA in MS Office. Be it good or bad there was more of this stuff in business than C related code in similar usage context.

When MS transitioned VB heaps (heaps++) of businesses and coders flipped out as heaps++ of that code out there would need be revisited to keep app's alice with the current Visual Studio environment. This is where VB lost heaps++ of jobs.

2. With Net 2.0 everything compiles to MSIL and uses the common language runtime. While C# may end up with a bit more efficiency in compiled constructs than VB Microsoft claims such differences are pretty much completely immaterial.

I will certainly agree that DNN would probably see an infusion of coders if they decided to go pure C# with the project. But... a BIG part of Microsoft's efforts have been to make the source language INDEPENDENT of the finished assemblies. Thus, there is no reason (assuming things are properly structured) that BOTH languages could still be utilized for say modules.

With that said when we want talk "speed/efficiency" whether its C# or VB according to Microsoft things are rather moot. Microsoft's goal in convergence of technologies is to BRING engineering to the non-engineer. This is well known to anyone who knows anyone "up the ladder" at Microsoft and they desire to do this across the entire development spectrum. Microsofts XNA project is a beginning of bringing game development to the massses, a very early beginning. Visual Web Developer is a sizeable step towards drag/drop truly dynamic web's. While presently one really still need understand engineering to do much I assure you within then next 10 years that will change. Microsoft is working towards a drag/drop, draw associations, set properties, describe environment and done apps/webs. Its WHERE the money is. They can service whatall, say 2 million coders around the world or create engineering software that billions can use and create apps, games, whatall. This IS the focus. In fact, numerous texts on ASP.Net 2.0 refer to using Visual Web Developer not as "webs" but as creating "portals"... an interesting tidbit.

Performance wise... well... You C# tribesman can scream and yell but reality is ole' unix/linux is still running rings around the MS technologies in performance. Java based Portals/CMS systems will support a FAR (far) larger load and will run rings around DNN in performance. This still stands true of Joomla/Mambo/Drupal as well not that I am a unix/php freak. I have no bias really.

Reality these days is what it is. For example, most AAA video games those that push graphics and CPU envelopes are all being coded in Java, its simply so much better in end performance that its the best choice. This also stands true for countless sizeable businesses. For example, Verizon, ATT (cingular) etc. that have countless retail outlets use those outlets service management via Java based apps/cms. When you sign up for a call plan, pay your bill at the counter etc. they all log to the internet and more and more are using java as it scales excellent. Since they are constantly changing the business models they are also constantly changing the UI's and business logic.

These sorts of centralized mechinisms are becoming more and more the standards for service oriented businesses. I did not know much of this until just a few scant weeks back when a friend of a friend and I met. He'd worked at Verizon and recently took a job with Circuit City regional engineering. Circuit City and according to him most large retailers are moving towards Java based applications. Essentially the platform is scalable, efficient, etc etc. enough in that large retail/service corporations can now tie together all aspects of business. While large hard goods retailers are only at the very beginnings of what's possible time will bring it to bare. Things such as using your digital cable or Internet to order at Walmart online, make sure items are in stock at a local store or store(s), warehourses, paid for via credit/debit card and later that day or the following all ready for you to pick up.

MS is quite aware of all this... The goal at MS is to bring 95% of what software engineering has been and still is today and transform it into simple drag/drop, associate various logic, set properties and wella... your average Joe can create real working app's without having to be a engineer thus creating a environment where billions of people can create software.
GeneralGood job! Pin
Rocky Moore8-Jan-07 14:09
Rocky Moore8-Jan-07 14:09 
GeneralRe: Good job! Pin
jyjohnson9-Jan-07 6:33
jyjohnson9-Jan-07 6:33 
GeneralRe: Good job! Pin
Rocky Moore9-Jan-07 7:31
Rocky Moore9-Jan-07 7:31 
GeneralRe: Good job! Pin
jonavi25-May-07 4:10
jonavi25-May-07 4:10 
Questionan Academic exercise only? Pin
jyjohnson8-Jan-07 8:32
jyjohnson8-Jan-07 8:32 
AnswerRe: an Academic exercise only? Pin
jonavi25-May-07 4:11
jonavi25-May-07 4:11 
GeneralSpecialized tools Pin
jeffb424-Jan-07 11:15
jeffb424-Jan-07 11:15 
GeneralRe: Specialized tools Pin
andrewcates4-Jan-07 14:58
andrewcates4-Jan-07 14:58 
GeneralRe: Specialized tools Pin
aaava21-Feb-07 9:51
aaava21-Feb-07 9:51 
QuestionWhat version Pin
scottpdotnet2-Jan-07 16:58
scottpdotnet2-Jan-07 16:58 
AnswerRe: What version Pin
andrewcates3-Jan-07 4:26
andrewcates3-Jan-07 4:26 
GeneralRe: What version Pin
Ashley van Gerven4-Jan-07 12:06
Ashley van Gerven4-Jan-07 12:06 
GeneralRe: What version Pin
andrewcates4-Jan-07 14:56
andrewcates4-Jan-07 14:56 
GeneralRe: What version Pin
Oakman8-Jan-07 9:21
Oakman8-Jan-07 9:21 
GeneralRe: What version Pin
andrewcates7-Jan-07 13:52
andrewcates7-Jan-07 13:52 
GeneralCode Pin
DeepToot2-Jan-07 8:42
DeepToot2-Jan-07 8:42 
GeneralRe: Code Pin
andrewcates2-Jan-07 8:54
andrewcates2-Jan-07 8:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.