App not running on beta testing machines. RRS feed

  • Question

  • TIA for you time

    I have am working application that upon deployment to other “testing machines” does not run properly.

    The app was developed on a Vista machine using Visual Studio 2008 and written in C#. The program also has a privately installed version of SQL Server Compact Edition 3.5 SP1 as part of the application.

    Predictably the app runs just fine on the development machine and the database is modified as expected. All is well.

    I am using InstallShield 2009 Express Edition v15 as my deployment tool.

    After installation on a one of my testing machines, the error messages is as follows:

      “Attempted to read or write protected memory, often an indication that other memory is corrupt.”

    I believe that I am missing something such as a .dll or .ocx or a .NET or an SQL file(s) in my installation to target machines.

    I have run through what I believe all redistributables that are necessary, but obviously I am missing something that needs to be installed on target machines.

    One clue is that when I try and uninstall the software via the Start Menu option I am told: “this action is only valid for products that are currently installed”. However, when I use Control Panel | Add/Remove Programs the product is there and can be uninstalled?

    I might add that on all of the machines tested, the installation went well and the program launched, but as I tried to “use” the program, the above error message was received.

    Included sql files in the distribution are:

    1)      Sqlceca35.dll

    2)      Sqlcecompact35.dll

    3)      Sqlceer35EN.dll

    4)      Sqlceme35.dll

    5)      Sqlceoledb35.dll

    6)      Sqlceqp.dll

    7)      Sqlcese35.dll

    8)      System.Core.dll


    10)   System.Data.DataSetExtensions.dll

    11)   System.Data.SqlServerCe.dll

    12)   System.Data.SqlServer.xml

    Thanks, hope this helps as I am stuck.




    • Edited by zotman Tuesday, May 12, 2009 4:11 PM
    Tuesday, May 12, 2009 2:22 PM

All replies

  • Hi,

    I guess you are working with SQL Compact 3.5 SP1.

    Please let me know if this is happening on a x64 bit machine or x86 machine (x64 bit App or x86 APP). 

    Please let me know the following:
    1. Call Stack of the exception
    2. How many times have you hit the issue

    Thanks & Regards,
    Devesh Anand

    Please click Yes, if my post was helpful.
    Tuesday, May 12, 2009 3:58 PM
  • Thanks for the reply.

    I changed my installation to include SQL Server 2005 Express SP2 and Sql Server 2000 Desktop engine (MSDE 2000) SP3a.
    I did this to see if adding any SQL things might help. Obviously I am guessing here. The the above installs did not help in fact the Desktop Engine install failed.

    What I get is an unhandled exception error! If you think, I can go back and add in a few more try/catches in the C# code to see if I get any different error messages than what I am getting.

    the program installs and launces, but as soon as I try much on the test machine I get an unhandled exception error

    with the unhandled exception I click on details and get a very long list of (I'm sorry) pretty uncomprehensible text.
    It asks if I wish to look at errors using JIT just in time debugging. Is this a good idea?

    I have even tried to install (this is all on the x86 test machines) .NET framework 3.0 and again I keep getting the error of:

    "Attempting to read or write protected memory" as listed above.

    Sorry, but I cannot see any "Call Stack of the Exception" value?
    The machines I am trying to install the app on are all X86 machines.
    And the error happens every time.

    On another test machine that is working better I have seen the following:
    SQL Server Services - SQL Express
    SQL Server Network Configuration - SQL express
    SQL Native Client 10.0 Congifuration
    .cab files (ARM V4)

    Interestingly enough the line pointed to in the source code as the error under Details is a cmd.ExecuteReader(). What is interesting
    is that prior to this line, I have already done several SQL queries such as ExecuteScaler(for a count) and an ExecuteNonQuery() with seemingly
    no problem?

    Maybe the above helps you.

    thank so much I am really after this one and can try anything you recommend.

    • Edited by zotman Tuesday, May 12, 2009 5:04 PM
    Tuesday, May 12, 2009 4:54 PM
  • Please get me the call stack to help you with the issue. SQL Express or any other installation will not help.

    We had an issue (with same error message) on x64 bit machine and has been resolved. But as you say you are testing on x86 machine that scenario does not apply to you.

    Thanks & regards,
    Devesh Anand
    Please click Yes, if my post was helpful.
    Tuesday, May 12, 2009 5:01 PM
  • 1) I promise that I am working hard to get this to work.
    2) I am really not sure how to get you a "call stack", but after some research I have tried my best. (see catch method below)
    3) Here is the coding segment and the MessageBox.Show values that appear from the the catch.

     //Now let's read the data from table Player into the listbox for viewing
                SqlCeDataReader rdr = null;
                SqlCeConnection con = null;
                SqlCeCommand cmdReader = null;

                    // Open connection
                    con = new SqlCeConnection(@"Data Source = |DataDirectory|\GolfDatabase.sdf");

                    //Set up comand with query and associate with current connection
                    string sql = "Select * from Player";

                    //Now pass the connection to the command object retrieves a dataset
                    cmdReader = new SqlCeCommand(sql, con);
                    cmdReader.Connection = con;

                    //execute query
                    rdr = cmdReader.ExecuteReader();

                    while (rdr.Read())

                        ID = rdr["Player_ID"].ToString();
                        aName = rdr["Player_Name"].ToString();
                        handicap = rdr["Handicap"].ToString();

                        if (string.IsNullOrEmpty(handicap) == true)
                            listBox1.Items.Add(ID + "     " + aName + "     " + "-");
                            linestoPrint[spot++] = ID + " " + aName + " " + "-"; //fill array with player data
                            fval = System.Convert.ToSingle(handicap);
                            fval = (float)Math.Round(fval, 1);
                            sub = fval.ToString();
                            listBox1.Items.Add(ID + "     " + aName + "     " + sub);
                            linestoPrint[spot++] = ID + " " + aName + " " + sub; //fill array with player data
                        }//end if

                    }//end while loop

                }//end try

                catch(Exception ex)
                    //Create an instance of the call stack
                    StackTrace callStack = new StackTrace();

                    //0 : current frame for the current method
                    //1 : Frame that called the current method
                    //2 : Frame that called the frame that called the cur:
                    StackFrame frame = callStack.GetFrame(1);
                    MethodBase method = frame.GetMethod();

                    string declaringType = method.DeclaringType.Name;
                    string methodName = method.Name;

                 }//end catch

                    if(rdr != null)

                    if(con.State == ConnectionState.Open)
                }//end finally

    1) First Message Box: "Attempted to read or write protected ememory. Often an indication that other memory is corrupt"
    2) Second Message Box: Form1
    3) Third Message Box: button3_Click

    Thank you for you help in this.
    Thursday, May 14, 2009 3:26 PM
  • Hello,

    Your problem seems to be related to SQL Server Compact version mismatch issue. See if this thread helps you:

    Imran Siddique.
    “This posting is provided "AS IS" with no warranties, and confers no rights”.
    Saturday, May 23, 2009 2:12 PM