Solved

.NET Renaming/Refactoring

Posted on 2009-04-01
3
169 Views
Last Modified: 2013-11-26
I have a .NET project that I want to copy, rename, and alter.  When I change the phrase "Department Notes" to the word "Customer" in all files, I run into problems with the compiler.  Is there a way to do this without running into all these issues?  (I'm doing this in Visual Studio 2008)
0
Comment
Question by:NigelRocks
3 Comments
 
LVL 9

Accepted Solution

by:
cdaly33 earned 200 total points
ID: 24040390
I'm not sure how many instances you need to change but it would be best to do the Replace one-by-one to make sure the replace all isn't changing something unintended such as a property, variable, or method name.
0
 
LVL 26

Assisted Solution

by:Anurag Thakur
Anurag Thakur earned 200 total points
ID: 24040630
search and replace is not an easy taks
you need to verify that what you intend to do is correct and will not break any interface and will not break the project compilation

best approach will be to find the references for "Department Notes" in the complete project and the replace them one by one
0
 
LVL 12

Assisted Solution

by:omegaomega
omegaomega earned 100 total points
ID: 24052115
Hello, NigelRocks,

I suspect that your problem may actually with the word "Customer".  The project may already contain a Property or Method with this name.  When you globally replace another word (or phrase) with the word "Customer" these replacements may appear to be invalid references to that Property or Method.

Before doing a global replace, you must be sure that the new word is not already in use in conflicting ways.    That is (before replacing "Department Notes" one-by-one as others have suggested) I would first search for the word "Customer" to see where that is already being used.

Cheers,
Randy
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question