As the PhoneBook tutorial explains, uigen.exe is a fairly robust tool as soon as you got the configuration and the setup right. uigen.exe is picky in that

The following instruction assumes the canonical project structure, as demonstrated with the PhoneBook project structure. We also assume that the re-motion assemblys are located in a sub-directory of the project root (as explained in in PhoneBook project structure).

uigen.exe data comes from several sources:

With all this considered, the invocation for the PhoneBook project looks like this:

PhoneBook.Domain\bin\Debug\uigen.exe /uigen:PhoneBook.xml /asmdir:Phonebook.Domain\bin\Debug

Before you can invoke it, however, some preparations are required.

Making sure that uigen.exe finds all assemblies

uigen.exe must load re-motion assemblys for reasons:

The simplest trick is to leave all the hard work to Visual Studio and do the following:

Make sure you have "Copy Local" set to TRUE, otherwise Visual Studio won't fix the dependencies for you:



The uigen.exe configuration file is an XML file and contains mainly "placeholders" for expanding all the project templates. Not all of them are relevant for your project, some are "legacy placeholders". The configuration file is an XML file and has two major nodes:

A complete discussion of the configuration file can be found here: uigen.exe configuration file. A sample configuration file can be found here: sample uigen.exe configuration file.

The canonical place for the uigen.exe configuration file is the solution root, i.e. above all your Visual Studio sub-projects. By convention, it has the same name as the entire project. For the PhoneBook project that's PhoneBook.xml.

Run uigen.exe

For the PhoneBook project, the invocation looks like this. In the solution root, invoke

PhoneBook.Domain\bin\debug\uigen.exe /uigen:phonebook.xml /asmdir:phonebook.domain\bin\debug

Again, this assumes that