pinvoke – C # WriteProcessMemory writes 0 written bytes

    public void Write(IntPtr address, byte() value) //The function I call for writing
        WriteProcessMemory(processHandle, address, value, value.Length, out int bytesWritten);
        Console.WriteLine("Written: " + bytesWritten);

    processHandle = OpenProcess(0x1F0FFF, false, process.Id);//How I open the process

    (DllImport("kernel32.dll", SetLastError = true))
    static extern bool WriteProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, byte() lpBuffer, int nSize, out int lpNumberOfBytesWritten);

No matter what address I want to write, it will always write 0 bytes. I also tried more types in one address float / int32 / int16 / int32 still wrote 0. But when I read the addresses it returns the correct value (same as in the cheat engine)