I started with a DNN 3.2 custom module. Used the 4.3 migration wizard to move it. After some adjustments, it works fine in both versions.
Now we (apparently - ??) have a need to release the module in 4.0 (I say apparently because there are lots of people doing that on SnowCovered). So I took the 4.3 version, migrated it back to be compatible with 4.0, and it compiles cleanly. If I package a source-code version of the assembly and install it in a test site, it runs fine. If I precompile and package an executable-only package, it kicks me in the teeth.
The first problem was that in the .ascx display page, I was using IsEditable (as in Visible="<%# IsEditable %>"), and I got an error "Name 'IsEditable' is not declared', which of course it is, in the portalmodulebase class. Just messing around, I redeclared IsEditable as protected shadows, and in the page_load routine I assigned it the value from MyBase.IsEditable. And that worked. DOn't ask me why, it doesn't make any sense to me.
So the next problem (and the one that is driving me nuts) is that the app runs a microsecond or two longer, then gets an error "Name 'FormatURL' is not declared". This is a bread-and-butter DNN routine, the only thing I have done to alter it is return a string.empty from the exception handler to get rid of the annoying "result not returned on all paths" warning. And as I say, in the source-code version of the module it runs fine. But precompile it, package it, deploy, adjust the deployment per Shaun Walker's article, and load it, and I get the "not declared" error and a page load exception.
I've tried loading fresh 4.0.3 websites and new databases, with the same result.
Somebody please tell me what I'm missing - I've burned several hours on this </whine>. Thanks.