Page 1 of 1

Compiling with 32-bit flag

PostPosted: November 5th, 2013, 5:53 pm
by mlavinder
Is there a way to setup Visual Studio to mark the assembly as requiring 32-bit without having to run a separate command? When I compile the project DEBUG it is fine, but as RELEASE I get a message saying:

Unhandled Exception: PHP.Core.PhpNetInternalException: Guarded call
InnerException: Native extension support is not available in 64-bit processes.
Please run this process on 32-bit OS or mark it as X86 using 'corflags.exe'.


I used corflags to mark it, but that seems like the Tool should have a way to do this but I cannot figure out how.

Re: Compiling with 32-bit flag

PostPosted: November 5th, 2013, 7:01 pm
by Jakub Misek
Hi,

Thanks for the question.

In debug, assemblies are compiled as x86 to allow integration with Visual Studio debugger.

In release, assemblies are marked as AnyCPU. As you noticed, the only issue is the native extensions support which works only in x86.

Currently there isn't any option for that. For web sites, you can configure Application Pool to "Run 32 bit application" as True. For console/winform apps, corflags is the only option.

Re: Compiling with 32-bit flag

PostPosted: November 5th, 2013, 7:59 pm
by mlavinder
I had seen that post-build events had been disabled. Is that still the case? Any idea when they will be re-enabled?

Re: Compiling with 32-bit flag

PostPosted: November 5th, 2013, 10:49 pm
by Jakub Misek
They should work, there is just no UI for them. I think if you add post build directly to .phpproj file, it should work.