I've changed one of my modules from WSP to WAP and I need to set the manifest to remove the old codeSubDirectory that is in the web.config for anyone that has the old version installed.
I've tried adding the following to the Manifest but I get an error: "A critical error has occurred.
Object reference not set to an instance of an object.
"
<component type="Config">
<config>
<configFile>web.config</configFile>
<uninstall>
<configuration>
<nodes>
<node path="/configuration/system.web/compilation/codeSubDirectories/add[@name='MyModule']" action="remove" />
</nodes>
</configuration>
</uninstall>
</config>
</component>