Posts tagged spark

Desert Code Camp Tomorrow!

I’ll be presenting “Introduction to Android Development” and “ASP.NET MVC2 with the Spark View Engine”. Sign up for yopur sessions here: http://www.desertcodecamp.com

If you’re in the area, I hope to see ya there!

My CODE Magazine Article Is Live

My first article with CODE Magazine is live. You can read it here. I cover ASP.NET MVC with the Spark View Engine. I cover a wide range of things and go in depth with examples with topics that include:

  • Inline Code
  • Element Constructs
  • Partials
  • Layouts
  • and more …

I hope you enjoy it! I enjoyed writing it.

A big thanks goes out to Chris G. Williams (twitter)for doing a stellar job on the tech editing.

Read it Here

Medium Trust is a PITA

There. I said it. Medium Trust is PITA. I wont be surprised if someone replies with  one of the following:

“Well, not really, you only have to do x, y and z and your code is compatible with medium trust environments”

or

“It’s there (Medium Trust) because code needs boundaries within controlled scenarios such as hosting environments.. “

Blah. Blah. Blah. You’re both right. However, it’s still a PITA. Why? In the past 4 months I’ve spent countless hours figuring out why my app is broken in a medium trust environment. I use certain tools to make my life easier (such as Castle Active Record, Windsor, ASP.NET MVC, Spark, etc) yet a lot of them assume full trust. They do have options to get them running under partial/medium trust but in my experience the debugging of these tools in said environments sucks.

Needless to say, I just got done debugging for 2.5 hours why my Spark MVC site would not precompile my views. The error was “No Input could be found". WTH!?! Finally, after walking through my app line by line I found the following in a Spark view:

 

${Html.ActionLink("Track Admin", "index", new { controller = "track" })} ${Html.ActionLink("Speaker Admin", "index" , new {controller="speaker"})}

 

The problem is that I had deleted those controllers and moved that part of the app. Once I removed the code, it recompiled fine. Completely frustrating and the root cause of this is Medium trust. I just spent 2.5 hours working on a debugging issue for Medium trust when I could be creating my app for a mobile start up company that I’m heading up.

Long story short : I’m not a fan of Medium Trust. I don’t know many people who are.

How Can we Get Around It?

I’m not sure we can in the .NET space. Other dynamic languages don’t seem to have these issues, but they do run into odd edge cases at runtime which can be even more of a pain to handle. So at this point, the only answer I have is to recommend any open source or commercial vendor to test their product on a lock down medium trust environment and provide very clear and concise instructions for how to get their product to run under medium trust.

New DimeCast: Spark Partials Part 2

I have another DimeCast up on DimeCasts.net.

More Info: In this episode we are going to continue looking at how to use Partials within the Spark View Engine.

In this episode we will take a deeper look at partials and learn more about their _undocumented_ features. We will also be learning how partials will allow us to create clean, compartmentalized and well organized code.

Check it out here.