My code was editted automatically on Visual Studio 2015 Community


  • Hello,

    I am using Visual Studio 2015 Community to create a Windows Form Application with C#. 1 month ago, some methods need to become static methods. I saved and compiled these. It ran Ok, but after that, my codes were editted automaticallly. I have  a new solution for my codes but I don't understand why my codes were editted?

    Next time, I have a ComboBox and I want to set the default item for it.

    comboBox.selectedIndex = 0;

    It ran Ok, but after that, this line were deleted. I don't understand?

    Why it happened?

    Thank you and Regard

    Monday, February 29, 2016 3:02 PM


  • Hi Thang Minh Tran,

    Please check the Date Modified for your edited code file in File System after you save it and then check the Date Modified again when you find it was edited "automatically" next time.

    If the Date Modified is not changed, the file is not edited after you save it. Please check whether you have saved it successfully.

    If the Date Modified is changed, the file really modified for many reasons. Please check below reasons which may causes your code file changed.

    1. Please close all third part software to make sure whether it modified by other programs.
    2. Please lock your computer after you leave, which can make sure it is not modified by others.
    3. If your solution connect to source control, please disconnect to the source control. It can help us make sure it is not updated before you check in.
    4. Please copy this solution to another path and then check whether it also has the same problem when the solution in another driver.

    Best Regards,

    Tuesday, March 01, 2016 6:29 AM