Skip to content
Ewen @ 8560wX edited this page Mar 7, 2016 · 4 revisions

####Terminology

  • Recycle - the process of linking or re-linking the source project into the destination project. It was one of the early names for this, I think the concept works so I keep using it, for now.
  • Link Zone - the XML placecholders in a destination project and everything in between. This bit...
<!-- CodeLinker
Source: PathTo\NameOfProject.csproj     <== this is optional
Exclude: PathTo\FileToBeExcluded.cs     <== this is optional
Include: PathTo\FileToBeIncluded.cs     <== this is optional
-->

<!-- EndCodeLinker -->

#iFAQa inFrequently Asked Question answers

  • Does it work with VB? Yes. Let me know if it doesn't (or fix it would be even better).
  • It does not write to any source projects, ever. It won't break them.
  • Does it work on projects that are on different disks? Yes, it should. It rescues anything it finds in the Link Zone that it thinks shouldn't be there. It then drops anything from the source project's folder before saving the Destination project.
  • Will I need to hand-edit a csproj / vbproj file? Probably but it won't kill you.
  • You can add more code or whatever to the destination project. If you (or Visual Studio) put it inside the "Link Zone" XML placeholders it should be moved outside them to a safe place in the next recycle. Should.
  • If you want to replace a file with the same name as the source project, manually add it as an Exclude: to the destination project (add it to the XML placeholder comment).
  • You will probably have to build your solution twice if a project is changed by a code-cloning process, mostly because of parallel builds and all that, the project was probably building while it was also being recycled. Expect that to be troublesome at times. If you build just the project that has the calls to CodeLinker (if that's how you manage it) by right-clicking the project in Solution Explorer => Build then it will be a tidier process.
  • I don't check for duplicated things, especially from multiple source projects or if you add a local file with the same name / class / starsign. fixed in #3..
  • If you don't specify a source in the placeholder it better be in the command line call.
  • Exclude: file or path. Wildcards are ok here. It is a simple string wildcard match. The log will tell you what was excluded and why.
  • Exclude: isn't picky about which source it excludes from, it is universal across any and all sources you have.
  • Every Code Recycle will re-recycle the source CSPROJ into the "recycle zone" between the XML comment placeholders.
  • You could hardlink the executable (or just makea shortcut - easier) in the solution root folder from its build folder in your local repo of this project so you don't miss out on damage control enhancements. Using it locally to your actual working project makes working out relative paths easier. Check the .exe into Git if others need it but ignore the CodeLinkerLog.txt log file.
  • The log file is continuous - delete it to reset it or you can mess with it in a text editor.
  • It doesn't re-link Project <References, or any references at all. It doesn't touch <PropertyGroup>s except when it makes the initial copy when creating a new project.
  • This is a version 0.0.0.1 - use it at your own risk. It may eat your kittens. I don't think it will but I've been wrong before. See the Refund Policy below for more details.
  • refactoring code with #if compiler directives can be tricky if you have any projects unloaded - some may get ignored as it may be considered "dead" code.
  • sometimes ReSharper got cranky when I tried to rename things, it wanted me to rebuild the Solution before it would play.
  • if you edit a source code file in any project it is recycled to, you edit it everywhere - they are all linked to the one file in the original source. #if compiler directives are one way to single-out code for specific builds.
  • Can you Recycle an already recycled Project? Yes. It should work. The CodeLinkerGui-3.5 project does this.
  • If you add all your Linked projects under a single root folder in the Solution then you can load and unload them all at once (right-click the solution folder in the Solution Explorer for that command). This is handy of you have a lot of them and are sick of waiting for them to build. The project files will still be updated when appropriate but be aware that any refactorings that only those projects see may be missed since the code may be considered "dead" and ignored.
Clone this wiki locally