Microsoft KB Archive/166677

= FIX: Extra Line Feeds Are Added When Moving File Between Folders =

Article ID: 166677

Article Last Modified on 5/2/2006

-

APPLIES TO


 * Microsoft Visual InterDev 1.0 Standard Edition

-



This article was previously published under Q166677



SYMPTOMS
Sometimes when a file containing at least one relative URL is moved into a folder that changes the reference to the linked file, an extra line feed is added to all scripts (whether contained within ... tags or within <%...%> delimiters) and comment blocks (enclosed with ).



CAUSE
When Link Repair is turned on, FrontPage Extensions look for relative URLs in the file. If found, they modify the URL as necessary to ensure that the linked files remain valid when called from the new directory. FrontPage Extensions may also attempt to insert missing HTML in the file. When this routine runs, it adds an extra line feed when it encounters server-side scripts.



RESOLUTION
Turn off Link Repair or use absolute references to linked files.



STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug has been fixed in Visual InterDev 6.0.



Steps to Reproduce Behavior

 * 1) Be sure Link Repair is enabled for the project (refer to the Properties page for the Project).
 * 2) Be sure your Project has at least one subdirectory, for example, /images.
 * 3) Create an .asp file with the following contents (you don't need a real .jpg file, just a relative reference): <% Response.Write "test" Response.Write "test2" %> 
 * 4) Copy this example to your Clipboard for reuse below.
 * 5) Release Working Copy for this .asp file and save to the root directory when prompted.
 * 6) Move the file into the images directory.
 * 7) Open the file. You are prompted with a message box that says, "Lines ending with only a carriage return have been detected. These will be modified to include a line feed."
 * 8) The file looks something like this: <% Response.Write "test" Response.Write "test2" %>    Visual InterDev has added syntax to make a legal HTML file. In the process it has added extra lines in the source ASP code and around the first two HTML tags.
 * 9) Release the Working Copy of this file, then move it back to the root directory. Open the file and replace its contents with the contents on your Clipboard. You should now be in your original state.
 * 10) Remove the IMG tag so there is no URL in your file or make the relative address absolute by placing a "/" before "images." Release the Working Copy and save as before.
 * 11) Move the file to the images directory again, and open it. This time nothing has changed because there is no relative URL in the file.

