App_Code being compiled in 32bit mode and place in Framework64 temp

I've ran into a really weird problem with a web application. I have an application marked as "Any CPU" for the platform target but when I run it through IIS I get the following:Could not load file or assembly 'file:///C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\ea146e97\e5f133b2\App_Code.dsbuukid.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format.It looks like this problem is being cause by that dll being compiled in 32bit mode where my IIS server is 64bit only. I've confirmed this by running the corflags.exe tool on that dell and getting the following:Microsoft (R) .NET Framework CorFlags Conversion Tool. Version 4.0.30319.17929Copyright (c) Microsoft Corporation. All rights reserved.Version : v4.0.30319CLR Header: 2.5PE : PE32CorFlags : 0x3ILONLY : 132BITREQ : 132BITPREF : 0Signed : 0I can solve this by setting the worker process to allow 32bit applications but I would much prefer to fix the problem and allow the app to run in 64bit mode.I've tried deleting my Temporary files multiple times as well as restarting the machine and iis a couple hundred times but every time the dll is compiled its in 32bit mode.Does anyone know how this is happening? What is responsible for the app_code compilation process?
 
Back
Top