I’ve been working with a project that processes a large set of data so I’m targeting x64 only. I needed to apply my performance and logging aspects to check execution times of each method but when I went to compile I received a build error from PostSharp

“Platform mismatch. You cannot run PostSharp on a 64-bit application from a 32-bit operating system.”

It was obvious that PostSharp was trying to run it’s post processor in x86 mode because my OS is 64-bit and the project is targeting x64 only. The question was “how do I tell PostSharp to work in x64 mode?”. The answer to resolving this issue is pretty easy because the developers at SharpCrafters have come through once again with great tooling for their product. You simply need to go into the project properties and click on the PostSharp tab, then set the “Processor Architecture” to x64. After that, you’re good to go.

ps-tab

What else can you do in here? Well you can also enable/disable PostSharp, enable/disable support for obfuscation and pass in additional properties to PostSharp just to name a few.

If you don’t have the latest version of PostSharp, grab it from PostSharp 2.1 and if you’re new to AOP or PostSharp, have a look at PostSharp Principals to quickly get to speed with PostSharp.

Advertisements