Solved

.NET Renaming/Refactoring

Posted on 2009-04-01
3
173 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

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…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

632 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