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 757229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:20:17+00:00 2026-05-14T15:20:17+00:00

Following this post which I posted some time ago, I now get the same

  • 0

Following this post which I posted some time ago, I now get the same error every time I try to rewire 2 web’s URLs.

Basically, this is the code. It runs in a LongRunningOperationJob:

SPWeb existingWeb = null;
using (existingWeb = site.OpenWeb(wedId))
{
    SPWeb destinationWeb = createNewSite(existingWeb);
    existingWeb.AllowUnsafeUpdates = true;
    existingWeb.Name = existingWeb.Name + "_old";
    existingWeb.Title = existingWeb.Title + "_old";
    existingWeb.Description = existingWeb.Description + "_old";

    existingWeb.Update()
    existingWeb.AllowUnsafeUpdates = false;

    destinationWeb.AllowUnsafeUpdates = true;
    destinationWeb.Name = existingWeb.Name;
    destinationWeb.Title = existingWeb.Title;
    destinationWeb.Description = existingWeb.Description;

    destinationWeb.Update();
    destinationWeb.AllowUnsafeUpdates = false;

    // null this for what its worth
    existingWeb = null;
    destinationWeb = null;
} // <---- Exception raised here

Basically, the code is trying to rename the existing site’s URL to something else, and have the destination web’s url point to the old site’s URL.

When I run this for the first time, I received the Exception mentioned in the subject.

However, every run after, I do not see the exception anymore.

The webs DO get rewired… but at the cost of the app dying an unnecessary and terrible death.

I’m at a complete lost as to what is going on and needs urgent help. Does sharepoint keep any hidden table from me or is the logic above has fatal problems?

Thanks.

  • 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-14T15:20:17+00:00Added an answer on May 14, 2026 at 3:20 pm

    In the end, I replaced the using block with try catch finally block, and nullify the references in finally. That exception has never bothered me again.

    Thanks.

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

Sidebar

Related Questions

I've posted about this last year because some university project and now I have
I'm trying to implement routing such as the following: posts/535434/This-is-a-post-title posts/tagged/tags+here // Matches {controller}/{action}/{id}
There was a post on here recently which posed the following question: You have
I posted a question yesterday, which I intend to get back to today however
this is following on from this question I posted yesterday - my question from
I need to solve the following question which i can't get to work by
Following this question: Good crash reporting library in c# Is there any library like
Following this example, I can list all elements into a pdf file import pyPdf
I've been following this tutorial (lesson 6) in order to build and deploy a
So I am following this guide: http://technotes.1000lines.net/?p=23 and I am going through the steps.

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.