CL_OUT_OF_HOST_MEMORY in clCreateKernel

Hi, i’m having an strange error.
I’m developing under MS VisualStudio 2010 and I have a program that if i run from VisualStudio works correct but if I run the .exe directly i’m getting the error CL_OUT_OF_HOST_MEMORY in function clCreateKernel. I tried running on CPU with Intel’s drivers and on NVDIA, but I have the same problem.

What do you think may be happenig?
Thank you.