Make sure that you are building the same solution configuration in VS and TeamCity (Build / Configiration Manager). Detele any unused solution configurations. Even if configuration is named "Any CPU", some projects could have x86 specified as target platform. If you are referencing 32-bit PDFViewerNET, than both blahblahblah and resulting exe project should be built as x86, not as Any CPU. You can also check 32-bit flag for blahblahblah and result.exe using corflags utility (available in Visual Studio Command prompt). Both dll and exe should have 32BITREQ set. If 32-bit flag is missing for exe, thatn you could try to set it using
corflags /32BITREQ+ result.exe
if that will fix the exe, then you should check solution configuration again, and make sure that x86 (not Any CPU) is specified as a target platform for exe.