locked
Deployment and/or registration failed with error: 0x8973190e RRS feed

  • Question

  • Hi i am getting the following error While Deploying my project to the Smart Device.

    Error 1 Deployment and/or registration failed with error: 0x8973190e. Error writing file '%csidl_program_files%\deviceapplication2\intermec.datacollection.cf2.dll'. Error 0x80070020: The process cannot access the file because it is being used by another process.
       Device Connectivity Component 

    This happened when i was deploying my project the second time on the device using Active Sync. I also checked the device running process but i didnt find my process in the list. When i restart the device it allows me to deploy the application. I want to fix my code and dont want to restart the device every time. I know there is some problem with the refernce release issue. Following is the code. Hope I get some help soon.  

    using

    System;

    using

    System.Collections.Generic;

    using

    System.ComponentModel;

    using

    System.Data;

    using

    System.Drawing;

    using

    System.Text;

    using

    System.Windows.Forms;

    using

    DeviceApplication2.com.sabic.sabicju.ju_webdev_2;

    using

    Intermec.DataCollection;

     

    namespace

    DeviceApplication2

    {

     

    public partial class EmployeeInformation : Form

    {

     

    private BarcodeReader bcr;

     

     

     

    public EmployeeInformation()

    {

    InitializeComponent();

    bcr =

    new BarcodeReader();

    bcr.BarcodeRead +=

    new BarcodeReadEventHandler(bcr_BarcodeRead);

    bcr.ThreadedRead(

    true);

    }

     

    private void bcr_BarcodeRead(object sender , BarcodeReadEventArgs bre )

    {

    txtBarCode.Text = bre.strDataBuffer;

    }

     

    private void menuItem1_Click(object sender, EventArgs e)

    {

     

    this.Close();

    bcr.Dispose();

     

    this.Dispose();

     

    Application.Exit();

     

    }

     

    private void btnPress_Click(object sender, EventArgs e)

    {

     

     

    if (string.IsNullOrEmpty(txtBarCode.Text))

    {

    lblError.Text=

    "Please select the BarCode First";

    }

     

    else

    {

    lblError.Text =

    string.Empty;

    getTheData();

    }

    }

     

    public void getTheData()

    {

    System.Data.SqlServerCe.

    SqlCeDataReader dr = null;

    System.Data.SqlServerCe.

    SqlCeCommand sqlCmd = null;

     

    string strConn = "Data Source =\\Program Files\\DeviceApplication2\\EmployeeInformation.sdf";

     

    try

    {

     

    System.Data.SqlServerCe.

    SqlCeConnection sqlConn = new System.Data.SqlServerCe.SqlCeConnection(strConn);

    sqlConn.Open();

    sqlCmd =

    new System.Data.SqlServerCe.SqlCeCommand("Select * from EmployeeInformation", sqlConn);

    dr = sqlCmd.ExecuteReader(

    CommandBehavior.CloseConnection);

     

    while (dr.Read())

    {

    txtName.Text = dr[

    "EmpNameEnglish"].ToString();

    txtDepartment.Text = dr[

    "DeptDesc"].ToString();

    txtID.Text = dr[

    "BadgeNo"].ToString();

    txtPhoneNo.Text = dr[

    "OfficePhone"].ToString();

    txtEmail.Text = dr[

    "EmailAddress"].ToString();

    }

    }

     

    catch (System.Data.SqlServerCe.SqlCeException exp)

    {

    }

     

    finally

    {

    dr.Close();

    dr.Dispose();

    sqlCmd.Dispose();

    }

    }

     

    private void Form1_Load(object sender, EventArgs e)

    {

      //txtBarCode.Text =

    "12345";

    }

     

    private void btnClear_Click(object sender, EventArgs e)

    {

    txtDepartment.Text =

    string.Empty; ;

    txtID.Text =

    string.Empty;

    txtName.Text =

    string.Empty;

    txtPhoneNo.Text =

    string.Empty;

    txtBarCode.Text =

    string.Empty;

    txtBarCode.Text =

    string.Empty;

    txtEmail.Text =

    string.Empty;

    lblError.Text =

    string.Empty;

    }

     

    }

    }






    Faisal
    Monday, April 6, 2009 6:53 AM

Answers

  • Hi Guan,

      You are right we can close the application from the following location
      Settings---System----Memory---running programs 

      The problem is device doesnot show my application in the list. I dont know why? If i can get any help. My device is intermec CN3.

      When i use remote process viewer from visual studio its shows the application exe is running if i open the application from the device and when i close the
      application in device it  disappears from the list in the remote viewer which is a normal process.

      I think for the time being i am not encountering the following Error and its current resolution is to close all the connections , freeing the refrences ,  
      close form and exit application and provide the explicit application close button or link and disable the Form Control Box property to False so that the
      application could be properly closed.
      Error 1 Deployment and/or registration failed with error: 0x8973190e. Error writing file '%csidl_program_files%\deviceapplication2\intermec.datacollection.cf2.dll'. Error 0x80070020: The process cannot access the file because it is being used by another process.
       Device Connectivity Component.

    Thanks


     


    Faisal
    • Marked as answer by FaisalJawaid Thursday, April 30, 2009 8:31 AM
    Wednesday, April 8, 2009 7:36 AM

All replies

  • Hi Faisal,

    Try following steps if your application has been depolyed to device:

    In the Solution Explorer, clike "References" in your project, you will find reference for intermec.datacollection.cf2.dll , right click it and click "Property", you will find "Copy Local" item and select "False".


    Best regards,
    Guang-Ming Bian - MSFT
    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    Wednesday, April 8, 2009 3:50 AM
  • I havent set intermec.datacollection.cf2.dll "Copy Local" to False . I tried freeing all the refrences in my code and after that i havent encountered the problem yet. Can you please ellaborate about the above solution. What i understand with it is by setting the property to "False" the application will not have the intermec.datacollection.cf2.dll in its bin folder and it will try to refernce it from GAC if it is already there.

    One thing more when i run my application why it doesnt appear as a running process or program in device? But when i use remote process viewer its shows the application exe is running in the device and when i close the application in device it disappears from the list in the remote viewer which is a normal process.
    Faisal
    Wednesday, April 8, 2009 5:17 AM
  • Hi Faisal,

    Maybe my previous reply is not correct, I just bethink of the problem that should be your application still run on the device, so the error message shows it is used by another process. So we have to close it before we deploy it again.

    We can use following way to close it:
    Settings---System----Memory---running programs


    There is a similar thread, which discussed it a lot.
    http://social.msdn.microsoft.com/forums/en-US/vssmartdevicesvbcs/thread/f0e45478-b711-4f90-b8b3-f8a08534f33b/



    Best regards,
    Guang-Ming Bian - MSFT
    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    Wednesday, April 8, 2009 7:11 AM
  • Hi Guan,

      You are right we can close the application from the following location
      Settings---System----Memory---running programs 

      The problem is device doesnot show my application in the list. I dont know why? If i can get any help. My device is intermec CN3.

      When i use remote process viewer from visual studio its shows the application exe is running if i open the application from the device and when i close the
      application in device it  disappears from the list in the remote viewer which is a normal process.

      I think for the time being i am not encountering the following Error and its current resolution is to close all the connections , freeing the refrences ,  
      close form and exit application and provide the explicit application close button or link and disable the Form Control Box property to False so that the
      application could be properly closed.
      Error 1 Deployment and/or registration failed with error: 0x8973190e. Error writing file '%csidl_program_files%\deviceapplication2\intermec.datacollection.cf2.dll'. Error 0x80070020: The process cannot access the file because it is being used by another process.
       Device Connectivity Component.

    Thanks


     


    Faisal
    • Marked as answer by FaisalJawaid Thursday, April 30, 2009 8:31 AM
    Wednesday, April 8, 2009 7:36 AM
  • Try to reboot emulator, pres that red button, it helped for me. :)
    • Proposed as answer by Quigath Thursday, July 12, 2012 6:10 PM
    Monday, December 28, 2009 12:33 PM
  • Thanks a lot ,on Reset the Emulator it worked fine .

    Wednesday, January 20, 2010 6:30 AM
  • Dear Nagaraj.M

     Try to review your code to free all refrences, Close DB Connection and provide proper exit from the application because restarting the device everytime is not the solution. I tried the mentioned steps and it worked for me and i didnt receive the message again.




    Faisal
    Saturday, January 23, 2010 7:05 AM
  • Reset did not work for me running emulation.

    My solution was to

    Click Tools
    Click Device Emulator Manager
    Right-click on selected Emulator
    Click Clear Save State

    Friday, September 20, 2013 3:59 PM