Teach Yourself Visual Studio® .NET 2003 in 21 Days [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Teach Yourself Visual Studio® .NET 2003 in 21 Days [Electronic resources] - نسخه متنی

Jason Beres

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید









Renaming Projects or Project Items


Renaming items in a project under source control is not much more difficult than adding new items. Remember that you're always working with a local copy of the data, so any change you make on the local copy must be reflected in the VSS database. If you have an item in your solution and you need to rename it, the first step is to check the file back in. After the file is checked in, you can right-click the file and rename it as you normally would. At this point, you're prompted to check out the project file because it must be updated with the new filename. After you check out the project and rename the item, the renamed item appears as a checked-out file in the Solution Explorer. At this stage, the original file still exists with the original filename in VSS. After you check in the renamed file to VSS, a new item with new history is created. The original file remains intact. To see this in action, you can rename a file and then look at the SourceSafe Explorer. In Figure 20.19, I renamed Form1.vb to FirstForm.vb in the Visual Studio .NET IDE. This caused me to check the renamed file into SourceSafe, thus creating two versions of the file.

Figure 20.19. SourceSafe Explorer after renaming a file from Visual Studio .NET.



Because the project file was updated to reflect the name of the newly renamed file, it is the only one to show up in the project. The original file remains in SourceSafe forever or until you delete it.

The recommended way to rename a file is to first rename the file in the SourceSafe Explorer. After the file is renamed in SourceSafe, you can select Get Latest Version of the File from Visual Studio .NET. At this point, the file is read-only from SourceSafe using your local copy. You can now rename the file to the same name you used in the SourceSafe Explorer. SourceSafe attempts to check the file out. When prompted, you should check out the file as you would normally. Because the local file version detects that the file has been changed in SourceSafe, you're prompted on a course of action to take with this file. If you select Continue from the warning dialog, the renamed file will be read-only in the Solution Explorer and it will match the version stored in SourceSafe.

This can become a little confusing if you're working with a team of developers and people are always renaming files. The best way to make sure that you aren't losing any information or any of your work is not to allow multiple checkouts. As a result, the only person affected by a change is the person who actually renames the file. After you check in your files, you can get the latest versions of the files from the server and your project is up to date.


/ 270