Resolved change project name

aronmatthew

Active member
Joined
Aug 5, 2019
Messages
41
Programming Experience
Beginner
Hello, I am trying to solve the simple problem of how to copy and rename a project. Although I have nearly solved this seemingly by replacing all of the name occurrences in the texts and file names, but now even that method has failed on a large project:

Error CS7065 Error building Win32 resources -- Unable to read beyond the end of the stream.

Also when trying to change the project name from project1 to project1.1 problem in the using and namespace extensions.
 
Last edited:
To me, that means that you have not renamed everything.

Did you unload the project and make sure that you updated all makes writing the .csproj?

Did you rename everything within the various .resx files?

Did you update any custom build commands?
 
To me, that means that you have not renamed everything.

Did you unload the project and make sure that you updated all makes writing the .csproj?

Did you rename everything within the various .resx files?

Did you update any custom build commands?

I have implemented a copy and replace method that replaces each directory name, file name and file text occurance, also a using and name space extension conversion. Works with example project but applied to a fairly large project it does not build and returns the compile error previously mentioned. However even if it did build in this case it fails at including character '.' in the file name for example newProject1.1. Their must be a way to simply rename the directories and certain files without touching the code.
To me, that means that you have not renamed everything.

Did you unload the project and make sure that you updated all makes writing the .csproj?

Did you rename everything within the various .resx files?

Did you update any custom build commands?
[/QUOT
 
Unfortunately there is no way unless the person who wrote the code planned for being able to rename things from the very beginning. From my experience, the default project templates created by Microsoft does not make such accommodations in the generated code. Strangely, the templates used to generate the code supports filling in the name, but it's a one time operation during the initial code generation.

Why is it so important to rename everything in the project are you trying to do like what a group recently did where they forked off an open source project (because the original project decided to change their license), but the group was caught red-handed where they simply just renamed namespaces, a few classes, and local variables, but unfortunately copied comments word-for-word?
 
Ummm... There are lots of source control tools that are available to you: git, Mercurial, Subversion, Perforce, etc.
 
Hello, I am trying to solve the simple problem of how to copy and rename a project. Although I have nearly solved this seemingly by replacing all of the name occurrences in the texts and file names, but now even that method has failed on a large project:

Error CS7065 Error building Win32 resources -- Unable to read beyond the end of the stream.

Also when trying to change the project name from project1 to project1.1 problem in the using and namespace extensions.

Hello @aronmatthew

As per my knowledge for error CS7065 you can check this step.

  • Ensure all resource files are intact and paths are correct.
  • Do clean and Rebuild. follow this step- Use Build > Clean Solution and Build > Rebuild Solution.
  • Please verify paths and resources in your project file.

Also you can do this for renaming from project1 to project1.1

Change the assembly and project names in the.csproj file and rename the project folder.
For namespace and utilizing directive updates, use the refactoring tools in your IDE.
Make sure that every project reference in your solution is current.

After making these adjustments, rebuild and clean your solution.

Hope this will help you:)

Best regards,
Akiragi
 
Recommendations
  • Get a trial edition of Jetbrains ReSharper
  • Do not use 1.1 in the project name, if you must then change the default namespace under project properties to Project1_1
  • ReSharper, Refactor -> adjust namespaces which does the heavy-lifting for you. ReSharper is very efficient with this.
  • ReSharper should be able to assist with resources also. May need some manual intervention.
Going with the above should greatly reduce the time it takes to correct your issues.
 
You are making the assumption that all the places where the project is name is at at will accept a dot in the replacement.

Following your logic that it should be as simple as replacing the text in all the files, can you reasonabling replace a project named "ABC" with namespaces and resources that start with "ABC" with the new project name "123" or "F-117" or "if"?
 

Latest posts

Back
Top Bottom