Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / IDE / January 2008

Tip: Looking for answers? Try searching our database.

how to copy to web while including all files in folder and subfolders

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jrl - 23 Jan 2008 05:50 GMT
When I want to copy an entire website, I'd like Visual Studio to copy all
the
contents of all the directories to the remote site. But it doesn't.
If I select all and copy these to the remote website, it will only copy the
files at the root and the folders visible at the root. It will not copy
files
within folders.
Is this something I can configure or correct? It seems kind of an obvious
problem if I can't, because this means I must laboriously open each folder
to
copy file contents.
WenYuan Wang [MSFT] - 24 Jan 2008 05:36 GMT
Hello JRL,

According to your description, you want to copy all the files/folders into
remote website by Visual Studio. But you found that VS didn't copy the
files within the folders, correct? If I misunderstood anything here, please
don't hesitate to correct me.

Could you please let me know which version of VS you are using (VS 2005 or
VS 2008)?

To copy all files at once, you can follow the steps as blew:
1. Right-click on the Source Web Site panel
2. Click "copy site to remote" in context menu.

Note: All files are copied, overwriting existing files, with the following
exceptions:
1. An older version of a file is never copied over a newer version.
2. The files being copied include a deleted file and the target still has a
copy of the file.
3. The files being copied are changed in the target site.

Have you checked if the files being copied include a deleted file on your
remote site?
To see files that have been deleted, select the "Show Deleted Files" check
box. The names of deleted files have a glyph next to them indicating that
they have been deleted.

Hope this helps. Let me know if this is the root cause. We are glad to
assist you.

Have a great day,
Best regards,

Wen Yuan
Microsoft Online Community Support
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
jrl - 24 Jan 2008 08:51 GMT
Thanks for the response, I look forward to solving this. You reflected my
question accurately. I found this occurred in VS 2005 and VS2008. Most work
will now be in VS2008, so I'll focus on vs 2008 for this question.

Your method of selecting the properties of the source panel (or any item
within it) and selecting 'copy web site' worked fine. I had previously been
selecting all the files and folders at the root of the source website, then
deselecting app_data (which I didn't want to copy) and finally clicking the
right arrow.

Or, in my efforts to make this work, I would delete all files (except
App_data folder and files) from the remote site, and then select all files
and folders (except App_data) on the source web site, then click the right
pointing arrow button. This would copy files at the root, and the folders,
but not the content files in the folders at the root.

Is it possible there is a fourth exception: if the target directory has a
deleted file, the source file will not overwrite it? This would not be
useful rule, I realize, but my tests suggest this.

For example: I created a new subfolder, called test in a folder at the
website root called techsupport. I created a file, default.asp in the test
folder. I clicked techsupport on the source, and the right arrow button,
resulting in the normal copy. I confirmed that default existed in the remote
subfolder. Then I deleted default.aspx from the subfolder on the remote
site.

Now I select the source folder (techsupport), the right arrow button, and I
expect this to copy default.aspx to the remote. I check, and it has not!

It isn't copying a file in a subfolder from the source, to a remote
subfolder with a deleted file of the same name.

Would be able to see if you can reproduce this? And any ideas on performing
this selective copy?
WenYuan Wang [MSFT] - 25 Jan 2008 10:35 GMT
Hello jrl
Thanks for your reply.

I have reproduced this behavior before. If the target directory has a
deleted file, the source file will not overwrite it. This is because VS IDE
will compare the timestamp of each file. The timestamp of the deleted file
in the target folder is equal to the timestamp of source file. This means
you have never made any change in the source file, and deleted this file
before. Thereby, VS IDE doesn't copy the source file to the target folder
unless there is a new version.

If you make any change on the default.aspx file, I believe VS IDE will
prompt "Confirm File Overwrite" dialog when you copy the folder to remote
website.

I think this behavior has been mentioned in the second exception:
The files being copied include a deleted file and the target still has a
copy of the file.

Anyway, if you want to copy the same file into remote website even though
you have deleted it before, you have to copy the file by select it in the
source panel directly.

Hope this helps. Let me know if you have any more concern. We are glad to
assist you.

Have a great day,
Best regards,

Wen Yuan
Microsoft Online Community Support
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
jrl - 26 Jan 2008 05:10 GMT
So when you say "The files being copied include a deleted file and the
target still has a copy of the file." you mean "the files being copied (from
the source) will
not overwrite a deleted file on the target". Have I understood you
correctly?

If so, is there any way to get rid of a deleted file on the target? I would
have thought that deleted files could be overwritten without problem, but
instead it would seem that deleted files are given some kind of protected
status.

In general, can you recommend an approach to efficiently copy the majority
(but not all) of the folders, including all the content of selected folders
and their subfolders? Typically I might make many little changes in a
variety of my source files, and then want to update the target site. Surely
there is a method to update the target site with the changed files.

Synchronize doesn't work. Copy doesn't work. Deleting everything on the
target and copying the new source doesn't work. I must be missing something
here...
WenYuan Wang [MSFT] - 28 Jan 2008 10:10 GMT
Hello jrl,

The file being copied will not overwrite a deleted file on the target
website. What you understood is correct. This is the reason why you noticed
some files in the sub folder cannot be copied to remote website.

To get ride the deleted file on the target website, you have to synchronize
you folder. VS IDE will prompt a "Comfirm File Delete" dialog when
synchronizing websites. If you don't want to delete the file on your source
website, please click on the "NO" button. After that, the deleted files on
your target website will be removed.

We suggest you can follow to following steps to copy your majority folder
to remote website in VS 2008.
1.    In the source web site panel, select folders/files which you need to
copy.
2.    Right-click on the files, and click on "synchronize selected files" in
context menu.
3.    VS IDE will prompt Synchronization Conflicts dialog. You can decide
which action you want to use.
4.    After that, please select folders/files which you need to copy in source
web site panel again.
5.    Click on "Copy Selected Files" in context menu to ensure that all
folders/files have been copied to remote website.

Hope this helps. Let me know if you have any more concern. We are glad to
assist you.

Have a great day,
Best regards,

Wen Yuan
Microsoft Online Community Support
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
jrl - 29 Jan 2008 21:03 GMT
> Have a great day,

Thanks very much. This is a great relief to understand the use of
synchronize. Problem is solved.
WenYuan Wang [MSFT] - 30 Jan 2008 07:33 GMT
Thanks for your reply, jrl. You are welcome.
If you face any more issue again, please feel free to update here again.
It is my pleasure to assist you. :)

Have a great day,
Best regards,

Wen Yuan
Microsoft Online Community Support
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.