Thanks very much for the response. Firstly, I have done as you have suggested and called the Dispose() at the top of the InitializeViewport() function (if the render target isn't null). So hopefully that'll help avoid any further problems.
Secondly, I define the position of viewport1 like that for no other reason than to have it defined somewhere. The location is only ever set at (0, 0) so this can't be causing a problem.
Now, I do actually do what you have suggested with the viewport colour. I clear my viewport0 with a grey colour and my viewport1 with a blue colour. The border I'm getting on the screen when changing resolution is blue. Also, I notice that my game graphics aren't just in the wrong place, they're also scaled up. This all leads me to believe that the problem might be with the matrix I'm using for my camera.
In my main Draw() method I use this:
spriteBatch.Begin(SpriteSortMode.Deferred, null, SamplerState.LinearClamp, null, null, null, Camera2D.camera1.GetTransformation(graphics));
which is calling the GetTransformation() method in my Camera class:
public Matrix GetTransformation(GraphicsDeviceManager graphicsDevice)
Vector3 newVector = new Vector3(-position.X, -position.Y, 0);
cameraTransformMatrix = Matrix.CreateTranslation(newVector) *
Matrix.CreateScale(new Vector3(zoom, zoom, 1)) *
Matrix.CreateTranslation(new Vector3(GameInfo.info.resolutionWidth * 0.5f, GameInfo.info.resolutionHeight * 0.5f, 0));
I must admit that I haven't really got my head around how a matrix works, but perhaps I'm doing something wrong here? This matrix is one I cobbled together for my previous game based on one I found online ages ago.