locked
Problems with Visual Studio only viewing past text, even once the text has been deleted RRS feed

  • Question

  • Hi

    I am having problems making visual studio view new text that i have typed. When I run the program only the previously typed code is seen?. How can I delete the previous code form memory.

    Kind Regards

    Martin

    Monday, August 10, 2020 7:20 PM

All replies

  • Do you save your new code in the file (what is the file extension)? Do you also re-build your application before running?

    Looking for new opportunities

    For every expert, there is an equal and opposite expert. - Becker's Law


    My blog


    My TechNet articles

    Monday, August 10, 2020 7:26 PM
  • Hello,

    Your question is to broad, please provided details e.g. what type of project, where (and what type of control) are you typing text and know the more details provided we then can focus on your issue rather than bounce back and forth asking for more details.


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    • Proposed as answer by Naomi N Monday, August 10, 2020 8:18 PM
    Monday, August 10, 2020 8:13 PM
  • Hi Karen

    Thank's for replying to my post. Ok, here's the code I wrote and happened when I tried to run the application.

    application Working withStrings

                    class Program

                   {   

                    static void Main(string[] args)

                    {

                    sting myString = "";

                    Console,WriteLine(myString);

                    Console.ReadLine();  

                    }

                    }

                   } Using a backlash character

                 string myString = "My\"so called life\";

                 I run the application\

                 My "so called life"

                //string myString = "My\"so called\" life;

                   string myString = "What if I need a\ new line?";

                 run application

                  string myString = "My\"so called life\"; 

                 I get the same result as before ?, even though I started a new string and hide the old string from view. It seems as though, the application simply can't clear it's memory and keeps repeating the answer for the first string. I hope this makes things a little clearer. Do you have any idea as what is actually happening.

    Kind Regards

    Martin

     

             

                    

    Tuesday, August 11, 2020 7:23 AM
  • Hi marti66,

    I tried according to your description, but did not encounter the situation you mentioned.

    Is it possible that you have two similar test projects and you modified A and ran B?

    If not, you may try to update Visual Studio to the latest version to see if this can be resolved.

    Best Regards,

    Timon


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, August 12, 2020 7:05 AM
  • Maybe you got a message box like this: “There where build errors. Would you like to continue and run the last successful build?” And perhaps you also selected “Do not show this dialog again” checkbox in the past. In this case, if there are errors, it will start the previous program.

    Make sure that your code does not have errors. Select Rebuild Solution from menu, check the errors in Error List window.

    • Proposed as answer by Naomi N Wednesday, August 12, 2020 1:16 PM
    Wednesday, August 12, 2020 7:31 AM