Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 743173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T08:49:56+00:00 2026-05-14T08:49:56+00:00

If I have a line like this ContentRepository.Update(existing); that goes into datastore repository to

  • 0

If I have a line like this

ContentRepository.Update(existing);

that goes into datastore repository to update some object and I have a try..catch block in this Update function like this:

        string file = XmlProvider.DataStorePhysicalPath + o.GetType().Name + Path.DirectorySeparatorChar + o.Slug + ".xml";
        DataContractSerializer dcs = new DataContractSerializer(typeof (BaseContentObject));
        using (
            XmlDictionaryWriter myWriter =
                XmlDictionaryWriter.CreateTextWriter(new FileStream(file, FileMode.Truncate, FileAccess.Write),
                                                     Encoding.UTF8))
        {
            try
            {
                dcs.WriteObject(myWriter, o);
                myWriter.Close();
            }
            catch (Exception)
            {
                // if anything goes wrong, delete the created file
                if (File.Exists(file))
                    File.Delete(file);
                if(myWriter.WriteState!=WriteState.Closed)
                    myWriter.Close();
            }
        }

then why would Visual Studio go on with calling Update() if I click “Stop” in debugging session on the above line?

For instance, I came to that line by going line by line pressing F10 and now I’m on that line which is colored yellow and I press Stop.

Apparently what happens is, VS goes to execute the Update() method and somehow figures out something gone wrong and goes into “catch” and deletes the file, which is wrong, because I want my catch to work when there is a true exception not when I debug a program and force to stop it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T08:49:56+00:00Added an answer on May 14, 2026 at 8:49 am

    It depends if the debugger detaching ends the process. If it doesn’t, then the program will continue to run. If it does, then it won’t.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have part of my script that goes like this: while read line do
I have a file that might contain a line like this. A B //Seperated
I have a line of php code that looks like this: echo <script>$('#edit_errors').html('<h3><em>Please Correct
I have a line in my SQL Stored Procedure that looks like this (works
I have cells that look like this, one per line: Duffy,John: 'Heritage: Civilization and
Im developing a simple application that have a line like this: string[] values =
I have a long line like this: <div class=interesting>This is interesting1</div><div class=not interesting>Some text</div><div
I have some javascript that is embedded in the html file like this <html>
I have a line that looks like this: $/Reporting/MSReportin gServices/Alle gro/Ex eXYZ.All egro.Ss rs:
Say I have a feature line like this: And I fill in Category with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.