I had to go through a number of steps to finally get PartCover working when calling it from a NAnt script. I collected everything I had to do here for others' convenience; note that some of this was already answered by others but I spent tons of time putting it all together.
First, as is answered elsewhere here, if your OS is 64-bit, you'll need to run [most recent Windows SDK]\bin\CorFlags.exe [PartCover install dir]\PartCover.exe /32BIT+ /Force
This is a one-time step, after PartCover install. It will change the executable, and warn you that the assembly will need to be re-signed, but I did not do that and it (eventually) worked fine. Note that even though it looks like CorFlags didn't do what you asked and warned you about signing, it did change the .exe, it just does not point that out explicitly.
Next, again if your OS is 64-bit, and you use NUnit (or another test exe) with PartCover, you will need to invoke a version explicitly compiled for x86. In NUnit's case, that would be nunit-console-x86.exe. Calling nunit-console.exe would just hang indefinitely for me after doing the work, and not return to a prompt.
Next, as is also answered elsewhere here, PartCover 2.3, a dev build, was failing silently even after running CorFlags on it. However, 2.2 worked.
Next, when PartCover.exe is invoked, the syntax for arguments is
-- arg-name ... and NOT --=arg-name (i.e. dash dash space arg name, not dash dash equals arg name); the PartCover docs seem to go both ways but equal sign just did not work for me.
After the above, PartCover was finally working from the command line. I used a settings file (you can use the PartCover browser UI app to save a settings file, which you can then use from the command line), so that the only args I specified were the settings file full path, and the output report file name full path.
This still wasn't working when invoked from a NAnt script, so I finally realized that the arg values had to be quoted... and to use the HTML encoded tokens for quotes. Thus...
NAnt excerpt:
<property name="PartCoverExePath" value="c:\Program Files (x86)\PartCover .NET 2\PartCover.exe" />
<property name="PartCoverWorkPath" value="c:\Projects\MyProject\trunk\CI\" />
<property name="PartCoverSettingsFileName" value="PartCover.Settings.xml" />
<property name="PartCoverReportFileName" value="PartCover.Report.xml" />
<target name="MyTarget">
<exec program="${PartCoverExePath}">
<arg value="--settings "${PartCoverWorkPath}${PartCoverSettingsFileName}"" />
<arg value="--output "${PartCoverWorkPath}${PartCoverReportFileName}"" />
</exec>
</target>
And the PartCover settings file:
<PartCoverSettings>
<Target>C:\CI\Binaries\NUnit2.5.2\bin\net-2.0\nunit-console-x86.exe</Target>
<TargetWorkDir>c:\Projects\MyProject\trunk\MyProject.Test\bin\Debug</TargetWorkDir>
<TargetArgs>MyProject.Test.dll</TargetArgs>
<Rule>+[*]*</Rule>
<Rule>-[log4net*]*</Rule>
<Rule>-[nunit*]*</Rule>
<Rule>-[MyProject.Test*]*</Rule>
</PartCoverSettings>
Phew! Hopefully this will save someone else the headaches I had.