Set Up IIS For An MVC App: When All Else Fails, Check View Config

by Jon Davis 29. April 2009 17:22

I got stumped today when trying to set up a CruiseControl.NET+RoboCopy powered development server deployment for an ASP.NET MVC web app. I set up MVC Framework (gets MVC into the GAC), did the wildcarding in the IIS app config, and everything worked fine, except for strongly typed views. I was confounded. The Event Viewer showed:

Exception information:
    Exception type: HttpParseException
    Exception message: Could not load type 'MyMvcApp.ViewPage<MyModel>'.

This turned out to be caused by a simple mistake. After cc.net compiles the app, RoboCopy copies all the .aspx files over to the web app, and ignores the .cs files, the .config files, etc., so that the .config files don’t get overwritten. I had manually deployed the main web.config file for the app, but I forgot that the Views directory also has a web.config.

Why there is a web.config in the Views directory, I don’t know yet. But the extra .config file in the Views directory is absolutely mandatory to get an MVC app working on IIS, or at least on IIS 6 anyway (haven’t tried 7).

Visual Studio 2008 Crashes When Using ASP.NET MVC (Nasty, NASTY Bug!)

by Jon Davis 16. April 2009 10:05

Some people (like me) have had issues with Visual Studio 2008 suddenly disappearing without errors when the developer user opens up an .aspx file, a .master file, or some other code file in an ASP.NET MVC project.

Had this show stopping issue beat me black and blue over the last 24 hours. I finally got past it when I used the /safemode switch with devenv.exe, but that disables all my lovely add-ins like Resharper. :(

Finally, one of the team members pointed me to “NDP20SP2-KB963676-x86.exe”. He had the same issue and tried to run this hotfix and it worked for him.

It seems to be working so far for me, too. The hotfix is here:

https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=16827&wa=wsignin1.0

File for Windows XP: NDP20SP2-KB963676-x86.exe

More info here: http://www.google.com/search?q=KB963676

MVC, TDD, ORM, WCF, OMG LOL

by Jon Davis 23. April 2008 22:05

Rob Conery, creator of the SubSonic ORM and scaffolding framework for ASP.NET, has been transparently publishing, in video format, what he understands TDD (Test Driven Development or Test Driven Design) in his presentations on the the reworking of the ASP.NET Storefront Starter Kit based on the ASP.NET MVC toolkit.

Surprisingly, the series has little to nothing to do with the storefront project. It's more of .. what I just said, Rob's transparent discovery process of TDD and keeping his process in check. That said, I thought it was a rarity among webcasts, something very much worth watching. Rob, who was recently brought into the Microsoft fold, has a way of making Microsoft look and feel human like the rest of us, using common sense and even humbly making adjustments of mindset and worldview according to the wise words of industry professionals as they give feedback. (This is something Microsoft has been getting good at lately, stepping out from their big Redmond city sized box and learning from a bit the rest of the planet, which is why I still root for them despite my relentless criticisms.)

Rob's discovery process is actually a very, very good opportunity for the rest of us to learn from. Rob came in prepared, he presented well, and the content and message are very good. While it was mostly review for me, TDD brings about such a different mindset to software that I feel like I need as many such "reviews" as I can find so that I can get it ingrained and rooted in my mental patterns.

That said, I am still greener than I want to be at ASP.NET MVC. This is just an issue of experiece; we're using it at work but I haven't been given the opportunity to implement, the other fellows have. Same with SubSonic.

I'm a big fan of SubSonic. I like its approach to ORM and its scaffolding.

Lately, though, I've been touching a bit with one of the software industry's best kept secrets among rediculously handy ORM solutions, and that is EntitySpaces. Mike Griffin's work with ORM tools has been around longer than Rob Conery's, and I've admired his work with both MyGeneration (a free, open source, and in many ways much better alternative to CodeSmith) and EntitySpaces for a couple years now. EntitySpaces is still pioneering in the ORM space, they've had a super-sweet ORM query object model that has been around and in production for much longer than SubSonic's recent "super-query" tweaks, which are still in beta. Makes us all wonder ...


Rob Conery

Mike Griffin
ROFLMAO.

Aside from the additional fact that ES works cleanly and happily on the Mac and on Linux with Mono, and aside from the additional fact that SubSonic is less about ORM and more about "building web sites that build themselves" (not everyone is building ASP.NET web sites, some people are writing software and just need a focused ORM solution), one thing I'm noticing recently about ES that makes it stand out from a lot of the other solutions out there is that an investment in ES on the server side is a really smooth and effortless transition to the client when you throw WCF in the mix, if all the client needs is the data models. The WCF proxy support in MyGen+ES makes client/server integration over WCF a snap. Part of this magic is also in Visual Studio, when you right-click References and add a Service Reference, the proxy objects are brought over from WSDL or a WSDL equivalent proxy definition, and you can begin coding on a seemingly rich object model on the client right away.

For me when I was tinkering with ES over WCF, being still green to ES, this brought TDD (actually integration testing) back into the picture. I found myself taking what I learned from Rob Conery on TDD and designing my services by executing tests--specifically, integration tests, which isn't pure TDD but I trusted WCF. I kind of had to; I needed to invoke the interfaces so that I could step through the debugger and introspect the objects and see what was going on under the covers as I was invoking code over the wire. This isn't pure TDD by principle but it is "test driven design" in the sense that I was finding myself writing tests that simulate real-world behavior in order to design how I want the code to function.

TDD, meanwhile, has made me think a lot about what I wrote half a year or so ago about Design Top-Down, Implement Bottom-Up. I didn't get much feedback on that post, but I, too, was being transparent with what I thought was a good idea. My word choice in that pattern seems foreign at first to TDD principles, if not contradictory, but the more I think about it the more I think it is actually very much complimentary.

  • In TDD, the tests simulate, by way of invocation, the top-down design and verify the bottom-up implementations, and
  • The implementations are kept in check by these simulations of top-down usage.

So I think TDD is really the glue, or a type of glue, that makes Top-Down-Bottom-Up work. I think the only big differences in perspective here are physical; TDD's perspective is a "I poke at you first, before you yelp", or forwards, perpective, Top-Down-Bottom-Up assumes that encapsulation is a layer, and the priority in the design process, over the implementation. (Or something.) It's all pretty much the same thing. And actually, while TDD validates the Top-Down-Bottom-Up process, TDBU validates TDD, too, because done right it uses TDD to prove out the stability and rock-solid implementation of an end product.

I'm feeling now like haacking (pun intended, for those who know) together a SuperText blog engine using a mish-mash of funzy geek stuff I want to keep pushing myself with including ES, ASP.NET MVC, TDD, REST, WCF, VistaDB, Silverlight, Javascript/AJAX, and Internet Explorer. Just kidding, I won't use IE ...

... not that I haven't built a complete blogging solution before.

MVC On The Client In Javascript

by Jon Davis 1. April 2008 04:30

I stumbled across this over the weekend.

http://javascriptmvc.com/

I was actually very surprised by how closely it resembles what we've been working on at the office. Ours uses a controller to manage and control events and event propogation, track "view objects" (we call 'em "client controls" for drag-and-drop support in Visual Web Developer) and manage AJAX calls. And we've spec'd out to use RESTful URIs to manage data model retrieval and callbacks, and these are cacheable using Google Gears, Flash storage, or *shrug* cookies.

Theirs has a few additional features, though, some of which I think we can glean from, like:

  • script librarian ("Include"), which we don't need but I think we could accomplish using something like JSLoader
  • a complete ActiveRecord-like modeling pattern
  • a complete ASP-like templating system that executes on the client
  • "everything is a plug-in" philosophy

I like what I see, although our own framework goes further as it is built with ASP.NET, ASP.NET MVC, Visual Studio, and Expression Web all in mind. With ours, we enable our web designer, who is not an engineer, to create a complete, non-Flash RIA web pages without coding. Using Expression Web or Visual Web Developer, he can click on one of our controls in the Toolbox, drag it out to the page, absolutely position it, stylize it, give it a data source URI, and have it subscribe to other controls' events (think Flash video player, responding to the events of media playback controls). The entire multi-page web site will support executing in the rich execution environment of a single-page RIA application with a seamless user experience. And since the framework is not done in Flash (although Flash "client controls" are supported), it will support continuous extensions using the wonderfully universal languages of HTML and Javascript, both at design-time (creating new controls, customizing existing controls) and at runtime (RESTful fetches of web content, dynamic execution of JSON models, etc).

In some ways, ours is looking like http://www.wavemaker.com/, except that WaveMaker is based on Java and dojo, and the designer experience is in-page (which is way too much support overhead--why reinvent the designer when Visual Studio / Expression Web can do the job on its own?).

But I'd certainly recommend Javascript MVC (JavascriptMVC.com) as a skeleton foundation framework for someone to roll their own framework. We were thinking about open-sourcing our client bits once we are done with our prototype, but I think Javascript MVC comes close enough that it would do just as well to recommend that one instead. Mind you, I have never used it, I'm only suggesting it based on what I'm seeing at their web site.

kick it on DotNetKicks.com

JSON and XML View Engines in ASP.NET MVC

by Jon Davis 28. March 2008 18:28

I posted earlier that we're working on a client-side MVC framwork that compliments the ASP.NET MVC framework. It's actually not formally MVC on the client, but it comes close. The view side is entirely controller-driven, even the event model. The "model" side of it is the ASP.NET server itself. So the server spits out both templated markup for the client-side controls, as well as the AJAX'd data models. These data models are models to the client but they are views to the server, or at least that's the way we're designing it.

So my co-worker posted his solution to XML and JSON callbacks, since ASMX is not MVC-friendly. It's a JSON view engine for MVC.

"I recently saw Scott Guthrie at a local .NET User Group event, and he mentioned that the ASP.NET MVC Framework was completely "pluggable", and you could easily replace the built-in View Engine.  So, I immediately searched for examples, found one ... tossed it out and whipped together a really quick and simple 'JsonViewEngine' class. Here's the code ..."

http://www.fragmentedcode.com/2008/03/27/jsonviewengine-for-aspnet-mvc-framework/

kick it on DotNetKicks.com

Currently rated 1.5 by 21 people

  • Currently 1.47619/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , , , ,

Software Development | Web Development

ASP.NET MVC Framework Source Code Released

by Jon Davis 25. March 2008 10:22

Microsoft released their beta source code for ASP.NET MVC.

http://www.codeplex.com/aspnet

What took me by surprise as I noticed the .zip file was just called "aspnet-###.zip" (where ### was a version), which made me wonder, what, is Microsoft going in the direction of moving ASP.NET itself to the open source community? I suppose to some extent that is already the case, although I wonder if WebForms' code will ever see the light of day.

Not that we want it or anything. (j/k.)

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,

Open Source | Web Development

ScottGu's Scottsdale '08 Presentations Now Posted

by Jon Davis 25. March 2008 09:51

ScottGu's presentations from his Scottsdale presentations here are now posted. http://weblogs.asp.net/scottgu/archive/2008/03/09/my-presentations-in-arizona-this-tuesday.aspx

I was there. Yay me. Sadly, though, I was with some co-workers who wanted to sit in the back. I couldn't see.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , ,

Software Development | Web Development


 

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen

About the author

Jon Davis (aka "stimpy77") has been a programmer, developer, and consultant for web and Windows software solutions professionally since 1997, with experience ranging from OS and hardware support to DHTML programming to IIS/ASP web apps to Java network programming to Visual Basic applications to C# desktop apps.
 
Software in all forms is also his sole hobby, whether playing PC games or tinkering with programming them. "I was playing Defender on the Commodore 64," he reminisces, "when I decided at the age of 12 or so that I want to be a computer programmer when I grow up."

Jon was previously employed as a senior .NET developer at a very well-known Internet services company whom you're more likely than not to have directly done business with. However, this blog and all of jondavis.net have no affiliation with, and are not representative of, his former employer in any way.

Contact Me 


Tag cloud

Calendar

<<  May 2018  >>
MoTuWeThFrSaSu
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910

View posts in large calendar