Can you make working samples downloadable?

Oct 11, 2011 at 2:45 AM

I suggest making the apps that results from the screencasts available for download (as additional CodePlex downloads). This way, after watching the screencast, one could directly run it without having to repeat the steps.

Oct 11, 2011 at 8:47 AM
Edited Oct 12, 2011 at 10:07 AM

I’m not quite sure how we’d do that. The ‘application’ would have to be deployed in IIS and unless the person has IIS Express on their machine, this would not be convenient for most people. Also, they’d need to have AdventureWorks installed on SQLExpress. Altogether that would make the idea of a simple downloadable application tricky - or have I misunderstood you?


One thing we could easily do is to provide our own on-line accessible version of the running app, just as a link for people to try out - periodically resetting the database. I think that most people who are interested in Naked Objects want to see how it works from a developer perspective - but there would be no harm in providing an application to try-out online. Do you think that would satisfy the need.

Oct 12, 2011 at 1:48 AM

By default, web apps in VS use Cassini (the development web server), so it should just run with no configuration. And I was more thinking about this being useful for the EF Code First sample, since there is a fair bit of code to be typed there to set things up. And in that case, there is no DB set up to worry about as EF just does it on the fly.

As for an on-line running version, that could be interesting as well, but I think devs will want to run it themselves so they can make small changes and see how that affects the app.

CodePlex tips: the CodePlex Forum is not very smart when you reply by email, and what you're replying to. I usually use the forum directly, or when using email, start clean when replying.

Oct 12, 2011 at 11:22 AM
Edited Oct 12, 2011 at 11:22 AM

Sorry, I misunderstood what you were asking for.  Good idea.  I've now added downloadable complete  solutions for both the Code First Example and the AdventureWorks Sample Application in the [Downloads] tab.

Oct 12, 2011 at 10:38 PM

Great, I downloaded the CodeFirst sample and it ran nicely. Well, except I can only create Customers and Products but can't seem to create orders.

Another good way to do samples is to put them up on Github or Bitbucket. e.g. I just put up the Code First sample on This way you can easily make small fixes and don't have to upload a new sample zip each time.

Oct 13, 2011 at 9:03 AM

Good suggestion  -  we use Mercurial so that tends to suggest Bitbucket (which we already use for some private repositories). I'll do that.

I have a question, though.  Now that we have the Sample app available as a single download (or as a repository per your suggestion), I am wondering whether we should get rid of the two sample NuGet packages  -  because, to be honest, it is a bit of a fiddle getting the Sample app up and running that way (you need to create two separate projects, link them, and do two separate NuGet installs).  The irony is, we only originally created those Sample packages at the prompting of your blog post: !

I'm now wondering if that blog post was really intended for simpler library-style NuGet packages, where (as you said) there isn't much documentation and other supporting stuff.

Oct 13, 2011 at 9:38 AM
In my opinion having sample apps available as NuGet packages does not add much value, considering what NuGet is for.
A direct download containing everything ready to run makes much more sense.

I don't know what the license implications are, but for the AW sample, even better would be if you could include the Adventure Works DB in the download as a standalone MDF served up by SQL Express on the fly.

So that it would literally be: Download, open, run.
Oct 13, 2011 at 10:16 AM

"Well, except I can only create Customers and Products but can't seem to create orders."

Having created and saved a customer, you should be able to click on the Actions menu on the Customer and invoke Create New Order.  (I did it this way just to illustrate the point that it is not necessary to have a repository for each type, because you can create/query objects directly using methods on other domain objects. In practice you probably would want an OrderRepository because you might want to retrieve an Order directly by an order number, without having to find the Customer first.

Oct 13, 2011 at 7:32 PM

NuGet for samples: yes, I think what I had in mind for NuGet for more about a really simple sample to lead users in right direction rather than a big sample. But to be honest, the NuGet sample things has not caught on much. Having full big samples in source control and/or as direct downloads may be the way to go here.

Creating orders: yep, that works, thanks!

Oct 16, 2011 at 5:07 PM

I have downloaded the CodeFirst sample from here and everything works for me except adding / updating line items

I get "An entry must be provided" when I  click save

[ArgumentException: An entry must be provided]
   NakedObjects.Reflector.DotNet.Facets.Objects.Parseable.ParseableFacetUsingParser`1.ParseTextEntry(INakedObject original, String entry) +114
   NakedObjects.Web.Mvc.Controllers.NakedObjectsController.GetNakedObjectValue(INakedObjectAssociation assoc, INakedObject targetNakedObject, String value) +165
   NakedObjects.Web.Mvc.Controllers.NakedObjectsController.ApplyChanges(INakedObject nakedObject, FormCollection form, INakedObjectAssociation parent) +609
   NakedObjects.Web.Mvc.Controllers.NakedObjectsController.ApplyChanges(INakedObject nakedObject, FormCollection form, INakedObjectAssociation parent) +1097
   NakedObjects.Web.Mvc.Controllers.GenericControllerImpl.ApplyEdit(ObjectAndControlData controlData, FormCollection form) +147
   NakedObjects.Web.Mvc.Controllers.GenericControllerImpl.Edit(ObjectAndControlData controlData, FormCollection form) +389
   RunMVC.Controllers.GenericController.Edit(ObjectAndControlData controlData, FormCollection form) in C:\Users\tbre02\Documents\Visual Studio 2010\Projects\NakedObjects2\RunMVC\Controllers\GenericController.cs:42
   lambda_method(Closure , ControllerBase , Object[] ) +158
Oct 17, 2011 at 9:42 AM

Thanks for reporting that.  Turns out to be a bug in the framework  -  not in the example code.  The framework was getting confused between the type names of Order and OrderLine.  If you re-name the OrderLine class to just Line (and delete the database so it will re-generate) then it should work fine.

The simple Code First demo is one that I recorded more than a year ago; I just edited the video for the new way of building Naked Objects using NuGet and didn't check the whole thing -  which I should have done.

We have now found the framework error and will be re-issuing shortly  -  hopefully later today (with a couple of other small fixes).  After that the original code first demo should work correctly.


Oct 17, 2011 at 10:05 AM
What is the recommended way of upgrading when I am still running a pre-opensource installation of NakedObjects MVC?
Oct 17, 2011 at 10:22 AM

For the model project(s):

- Remove all references to any nakedobjects .dlls
- Install the NuGet package NakedObjects.Programming model, as for a new such project.

For the MVC project(s),the easiest way will be to create a new run MVC project the new way, and then to merge your customised views/controllers into the new project. 

(There were no changes to Views/Controllers/Scripts between the September proprietary release and the first open source release, but there were other project changes, such as RunWeb moving from the Global.asax into App_Start.

I honestly think that will be quicker than working the other way -  though you could try that and use source versioning to identify the changes.

Oct 17, 2011 at 10:06 PM

Yes, that's worked. Thanks Richard