user82218: Was there a recent change where it is no longer possible to specify rpcport?
I noticed these two warnings:
Warning: Config setting for -addnode only applied on test network when in [test] section.
Warning: Config setting for -rpcport only applied on test network when in [test] section.
After trying adding a [test] section I got very mixed results as some times it disregarded all options and in general rpcport was still not set.
I could not find any documentation on how to do this.

user659: For any of addnode, connect, port, bind, rpcport, rpcbind, and wallet you should move them into the [test] and/or [main] sections of your bitcoin.conf. You can also move any other setting that you want only applied to mainnet or testnet into the appropriate section.
Example:
server=1
daemon=1

[main]
prune=1000

[test]
rpcport=55555


82218: <p>Was there a recent change where it is no longer possible to specify rpcport?</p>

<p>I noticed these two warnings:
Warning: Config setting for -addnode only applied on test network when in [test] section.
Warning: Config setting for -rpcport only applied on test network when in [test] section.</p>

<p>After trying adding a [test] section I got very mixed results as some times it disregarded all options and in general rpcport was still not set.</p>

<p>I could not find any documentation on how to do this.</p>
 659: <p>For any of <code>addnode</code>, <code>connect</code>, <code>port</code>, <code>bind</code>, <code>rpcport</code>, <code>rpcbind</code>, and <code>wallet</code> you should move them into the <code>[test]</code> and/or <code>[main]</code> sections of your <code>bitcoin.conf</code>. You can also move any other setting that you want only applied to mainnet or testnet into the appropriate section.</p>

<p>Example:</p>

<pre><code>server=1
daemon=1

[main]
prune=1000

[test]
rpcport=55555
</code></pre>
