Solved

.NET Renaming/Refactoring

Posted on 2009-04-01
3
165 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

758 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now