# 08 Nisan 2008 Salı
At last. Preview 4 is here. Spread the word :)

I'm very sorry that I couldn't be able to align this release with the Visual Studio 2008 release back in November. I failed to allocate time and couldn't be able to organize people trying to help. Won't do that again.

There are still lots of thing to do but AW is getting much better with each release, thanks to patch submissions and suggestions. Here's the complete what's new list:

  • Added support for Flush for ManyToOneRelation
  • Added partial Oracle drag and drop support. (Patch: Yavor Shahpasov)
  • Generates metadata about properties to be used in queries (as in ICriterion selectCriterium = Expression.Eq(User.Properties.Name, name); )(Thanks: Rudi van den Belt)
  • Contrib-30: Add flag to property to mark it with the DefaultMemberAttribute (or do it by default for primary key fields) (Thanks: Michael Hawksworth)
  • Contrib-50: (Revised description) Allow user defined imports to replace generated imports. (Thanks: Michael Hawksworth)
  • Contrib-54: Integrate NHibernateQueryGenerator into ActiveWriter (Thanks: Steve Degosserie)
  • Contrib-81: Added list relation type. (Patch: Grimace of Despair)
  • Moved all to vS2008
  • Moved binaries license from "as is" to Apache v2. We don't need DSL Tools redistributables in setup package anymore.
  • ManyToOne SourceNotNull is now working propertly
  • Incorrectly generates Some pascal case fields as camel case.
  • Contrib-52: (Revised description) Generic types are incorrectly generated if the given type name already includes generic parameters. (Thanks: Hugo Burm)
  • CONTRIB-59: (Revised description) Problems with NHQG integration when the temporary path, used for out argument, contains spaces. (Patch: Steve Degosserie)
  • Contrib-56: When creating a many-one relation, the generation of the Ilist should always be generic, independent of the generic settings for the objects. (Thanks: Robert van Hoornaar)
  • Contrib-61: (If the namespace cannot be retrieved from the VS project system) When a class is added to a model, the .hbm.xml file that is added as a nested file is missing the first character of the class name in the filename. (Thanks: David Gardiner)
  • Contrib-63: VB projects can have a default root Namespace. ActiveWriter should take this into account when generating the mapping files. It currently appears to only use the model's Namespace property. (Patch: David Gardiner)
  • Contrib-66: The private field used by the relation properties should be initialised with a constructor (Patch: David Gardiner) (Added as a model level option, defaults to false)
  • Contrib-69: Generated VB code should respect project's Option Strict setting (Patch: David Gardiner)
  • Contrib-70: Using a custom type that is defined in a user project fails (Partial patch: David Gardiner)
  • Contrib-72: Option to remove prefix from generated property names.(Patch: David Gardiner) (Implemented as model level RegEx)
  • Contrib-73: Look for Castle.ActiveWriter and NHibernate in project references. (Patch: David Gardiner)
  • Oracle support is now fully working (Patch: Marjan Flis)
There are some bug fixes and improvements in the DSL Tools itself, which directly affects AW. Most notably, the giant red X problem happening time to time when you drag-drop items from Server Explorer is gone with the 2008 release. Another improvement is, DSL Tools redistributables are now included in the IDE, so they're not included in the AW setup, resulting in a smaller download.

Preview 4 will be the last release for VS 2005. It's very hard for me to maintain both 2005 and 2008 versions, so I'm planning to continue with 2008-only releases. But if you encounter a show-stopper bug in 2005 release, I'll fix it.

As always, you can mail me using "gokhan (a) altinoren.com" with all your suggestions and patches.

posted on 08 Nisan 2008 Salı 10:11:14 UTC  #   
# 03 Nisan 2008 Perşembe
It appears that people are having trouble finding templates for some of the documents mentioned in MSF Deliverables Matrix. Here is the Initial Risk Assessment template I created for a client, an excel representation of the ideas in MSF Risk Management Discipline v1.1 document. Enjoy.

Initial Risk Assessment.xlsx (21.81 KB)
posted on 03 Nisan 2008 Perşembe 07:34:26 UTC  #   
# 01 Aralık 2007 Cumartesi
Just for the fun :)

Download: TDDOANG.pdf (734.42 KB)

  • Yeah. I know it's not complete / 100% accurate.
  • Yep. There are other tools, I know.
  • Yes, Alt.Net is not the authority. But it's the most active community in MS ecosystem right now where you can ask questions on TDD.
posted on 01 Aralık 2007 Cumartesi 11:29:37 UTC  #   
# 23 Kasım 2007 Cuma
A small tidbit. In WCF, service code like this

public string MyServiceMethod()


    throw new FaultException<string>("It happened!");


will make VS break into debugger. Normally you just throw FaultException's, knowing that the dispatcher hadles it to convert it to a fault contract message. But VS thinks that it's an unhandled user exception (it is, actualy). For a smoother debugging experience, just add System.ServiceModel.FaultException`1 to Debug / Exceptions / Common Language Runtime Exceptions, unchecked.

posted on 23 Kasım 2007 Cuma 07:07:15 UTC  #   
# 29 Ekim 2007 Pazartesi
I have seen Roy's frustration on having a will-expire VPC on the lap, three days before a serious event where he is the speaker planning to use the exact same VPC! Yay.

Here's a quick possible fix to the problem before 1st of November. This is the ninja tactic I have been using for expired VPC's for whatever reason.

  1. Break the date synchronization between the host (your pc) and the VPC image.
    To do this, you should add the following lines (in bold) to the .vmc file (I did this to both Base01 and OrcasBeta2_VSTS vmc files, to be safe):
        <!-- ... other things -->
              <!-- ... other things -->
                        <enabled type="boolean">false</enabled>

  2. Start VPC image. Change date to sometime in the past.
  3. Restart VPC, it won't be in sync with the host anymore.
I tested this by changing my computer's time to 2nd of November, worked for me as shown in the following screenshot:

Based on my past experience it will work forever, but I'm not guaranteeing anything. I don't know if this will work when the actual day comes for this particular VPC image. So, backup your data, don't rely on this for the morning of 1st of November, and take this info AS IS.

Jeff Beehler says:

"I would strongly advise against changing the system time on the VPC if you're using TFS as TFS counts on time always moving forward.  You cannot make a check in or save a work item with an earlier date than the last one for obvious reasons.  So, if you're using the VPC in production, you could get yourself into a situation where you can't check in which would obviously be problematic."

He has also a solution for the expiration problem if you have a valid 2003 Server media and key.

So, yes, unless you're using TFS on the image, you may use this trick. And this makes it invalid for Roy's case.
posted on 29 Ekim 2007 Pazartesi 12:51:31 UTC  #   
# 18 Ağustos 2007 Cumartesi
This is mainly a service release, fixing some nasty bugs or "features".

AW now supports international versions of Visual Studio better. Preview 3 introduced hbm.xml generation but a bug prevented it to be usable without intevention. And drag-drop support for MySQL was broken if the user have a different version of Connector installed. All should work OK now.

Download here.

Preview 3.1 Release - 18/08/2007

What's New:
  • CONTRIB-31: "Lazy" One-to-One relation. (Thanks: Gabriel Schenker)


  • Server Explorer drag'n drop is now supported on international versions of VS. (Patch: Daniel Rothmaler)
  • Server Explorer support changed to VS Connection Service and its Connection Hierarchies, instead of the Server Explorer's UIHierarchies to prevent the flicker during the hierarchy traversing process. (Patch: Daniel Rothmaler)
  • Closing Contrib-25. ValidateNotSameAttribute Won't be supported ATM.
  • CONTRIB-33: When adding a table (SQL Server) to the designer which has a primary key of type uniqueidentifier ActiveWriter should use "Guid" instead of "Native" as generator (Thanks: Gabriel Schenker)
  • Assembly names in NHibernate configs are incorrectly stripped from the name. (Thanx: Fedde)
  • Removed dependency to MySQL.Data.dll to prevent runtime version conflicts. Moved to IDbConnection for all metadata retrieval jobs. (Thanks: Joao Paulo Marques and Shane)

posted on 18 Ağustos 2007 Cumartesi 12:39:10 UTC  #   
# 21 Haziran 2007 Perşembe
I was about to cry after reading Scott Bellware's this post (via Roy). He says you can't develop OSS for Visual Studio because VSIP license prevents you to do so, which means my little ActiveWriter is kaboooom.

He's wrong. Well, the text he's referring to is a bit outdated. In the newer license, MS removed some clauses to make it more open source friendly, see this post for more info. In the comments of Bellware's post, Scott Guthrie also confirms that there's no restriction.

Frustration for a couple of seconds, then I'm happy again.

posted on 21 Haziran 2007 Perşembe 12:38:27 UTC  #   
# 14 Haziran 2007 Perşembe
Preview 3 has this functionality, but there are a few things to mention.

ActiveWriter use ActiveRecord assembly to generate NHibernate config files. So you'll need Castle.ActiveRecord.dll, NHibernate.dll and all necessary dependincies to make it work.

  1. Set the target to NHibernate
    This way, AW will generate .hbm.xml files for each entity in your model.
  2. Set the Assembly Path to where Castle.ActiveRecord.dll, NHibernate.dll and all necessary dependincies reside.
    The design decision was that, I didn't want to package these assemblies with AW. Rather than that, I thought user will most probably have them so they can choose whatever version they want to generate the configuration. If you don't supply the path, AW (VS, actually) will look for them in GAc and then {Your VS Path}\Common7\IDE\Castle.ActiveRecord.dll, so if you have them in one of those places, it should be fine.

    One other quirk is, if you first try to generate with the wrong path, setti ng the correct one later won't work until you restart Visual Studio. This is the framework's limitation, once you try to load an assembly and get an error, the result will be cached for subsequent tries. So VS appdomain should be restarted to make it work. I'll have a possible soliton for this for a future version of ActiveWriter (will try to load in a dummy appdomain, then in the VS appdomain)

    You may use the fully qualified assembly names for Active Record Assembly Name and NHibernate Assembly Name to target a specific version in the GAC, if you have more than one in there.
  3. When you save the model, AW will generate configuration.
I'll prepare a better documentation in the wiki.

Have fun.


AW does not work with release version of Castle assemblies (RC2?) for NHibernate generation, it works with the trunk (or with recently compiled assemblies). You can use the latest bits from the build server: http://builds.castleproject.org/cruise/index.castle
posted on 14 Haziran 2007 Perşembe 11:46:32 UTC  #   

This was sitting on the trunk for a while because of a bug in NHibernate config generation. I believe it's fixed now, so let's see if it works :)

First of all, this release is trying to be compatible with Castle trunk, it may generate code usable by released Castle components but it follows recent changes (might miss a few days). You know, Castle will be 1.0 one day and ActiveWriter will be a release, not a preview, in that day.

And I'm trying create some documentation on using.castleproject.org (Castle's wiki) to make Hammett stop whining about the lack of documentation of contrib projects (kidding!). If you're using ActiveWriter and want to share your tips, tricks, workarounds or anything about it, it would be great if you contribute to the documentation.

The most important update is the direct NHibernate configuration support. Now you can instruct ActiveWriter to generate NHibernate configuration files (.hbm.xml) for each entity in your model. Generated classes won't have ActiveRecord attributes in this case. More on this in a later post (Update: here).

Another interesting change is the use of Castle.Components.Validator instead of the ActiveRecord validators. AR changed in the trunk to use it, so does ActiveWriter.

One more exiciting news is, you can drag tables of MySQL from Server Explorer onto the modelin surface (see Michael's patch below).

Full list of changes below. A big thanks to all who sent patches, ideas and bug reports.

  • Now optionally generates NHibernate hbm.xml files.
  • Namespace in generated code is now customizable (Idea: Robert van Hoornaar)
  • Imports in generated code is now customizable (Idea: Robert van Hoornaar)
  • Model classes can override model level base class definition. (Patch: Robert van Hoornaar)
  • Model classes can override model level generics generation. (Idea: Robert van Hoornaar)
  • Contrib-26: Add support for AR Nested / NH Component mappings. Allow the ability to specify a column prefix for active record. (thx: Adam Tybor)
  • Optionally generates classes implementing INotifyPropertyChanged.
  • Support for drag-drop from Server Explorer for MySQL databases. Requires MySQL Connector/Net (5.1) (included). (Patch: Michael Morton)
  • Support for custom types through IUserType. See http://support.castleproject.org/browse/CONTRIB-28#action_11456 for usage. (Patch: Ricardo Stuven)
  • Ability to define a nested class with a different property name than the nested class (Idea: Craig Neuwirt)
  • Contrib-23: Produces CascadeEnum instead of ManyRelationCascadeEnum
  • Ability to generate virtual properties to support Lazy properly (thx: Ayende)
  • Make sure that Char and AnsiChar types are treated as a System.String types, instead of System.Char types (patch: Ayende)
  • HasAndbelongToMany does not take custom property names and not found behavior into account.
  • Can’t add a Many To Many relationship to 2 entities when the Class and Table names are different.
  • Column keys in many-to-one relations is not optional. (Patch: Robert van Hoornaar)
  • Partially fixing NHibernate code generation errors. Now works with a workaround.
  • Nullable types only when NotNull=false (Patch: Ricardo Stuven)
  • Changed to Castle.Components.Validator
And just one more thing. Someone asked me if ActiveWriter is a competitor for Linq to SQL. AW is just a servent of the heavyweight champion, NHibernate/AR combo. Linq to SQL is competing with NHibernate. I didn't have time to examine Linq to SQL designer, but it's built using DSL Tools just like ActiveWriter so some functionality should be alike. Other than that it's the framework, not the tools, important.
posted on 14 Haziran 2007 Perşembe 08:29:25 UTC  #