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
uigen.exeworks for your project, you have to edit the
uigen.execonfiguration file to make it work for a different directory. This can bite you if you don't know this and try to duplicate a successful generation for a web project on a different disk or in a different directory.
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:
TabbedEditor.xml, but this is under the hood for the purpose of common
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.
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:
uigen.exein your domain project, i.e. make the
uigen.exeexecutable part of the ensemble of referenced re-motion assemblys. For the
PhoneBook.Domainproject this looks like this:
Make sure you have "Copy Local" set to TRUE, otherwise Visual Studio won't fix the dependencies for you:
DONT FORGET TO REBUILD YOUR REBUILD YOUR DOMAIN PROJECT
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:
<settings>– paths needed by
uigen.exeto find its template files and resources
<placeholders>– that's your configuration
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
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
uigen.exeexecutable has been copied to the domain project's
bin\Releasedirectory by Visual Studio (as explained in
/uigen:switch specifies the name of the
/asmdir:switch specifies the directory where the domain assemblys can be found. (This is inconsistent with
/baseDirectory:switch, but it has the same meaning.)