Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. C# code replacement in older application using NReFactory library

C# code replacement in older application using NReFactory library

Scheduled Pinned Locked Moved .NET (Core and Framework)
tutorialcsharpsales
3 Posts 3 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sethupathiram
    wrote on last edited by
    #1

    Dear friends, I wanted to create small tool which is used to replace some part of code in c# file from older application long back developed. My customer is advised to use NReFactory library. Already I have gone through that about NRefactory in code project. I'm bit confused because it has lot of features like code compilation and analysis etc. Please guide me which NReFactory library do I need to use for my requirement. Is there any sample code specific to code replacement. Example: 1. Reed old c# file 2. Replace old namespace, type and property to new one 3. Create a modified file in new system location. Thanks in Advance 😊 Regards, Ram Ram

    L J 2 Replies Last reply
    0
    • S sethupathiram

      Dear friends, I wanted to create small tool which is used to replace some part of code in c# file from older application long back developed. My customer is advised to use NReFactory library. Already I have gone through that about NRefactory in code project. I'm bit confused because it has lot of features like code compilation and analysis etc. Please guide me which NReFactory library do I need to use for my requirement. Is there any sample code specific to code replacement. Example: 1. Reed old c# file 2. Replace old namespace, type and property to new one 3. Create a modified file in new system location. Thanks in Advance 😊 Regards, Ram Ram

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      using ( StreamWriter sw = new StreamWriter( "Outfile.txt" ) ) {
      sw.Write( new StreamReader( "Infile.txt" ).ReadToEnd().Replace( "OLD", "NEW" ) );
      }

      1 Reply Last reply
      0
      • S sethupathiram

        Dear friends, I wanted to create small tool which is used to replace some part of code in c# file from older application long back developed. My customer is advised to use NReFactory library. Already I have gone through that about NRefactory in code project. I'm bit confused because it has lot of features like code compilation and analysis etc. Please guide me which NReFactory library do I need to use for my requirement. Is there any sample code specific to code replacement. Example: 1. Reed old c# file 2. Replace old namespace, type and property to new one 3. Create a modified file in new system location. Thanks in Advance 😊 Regards, Ram Ram

        J Offline
        J Offline
        John Torjo
        wrote on last edited by
        #3

        Instead of creating your small tool, I suggest you use Resharper, and do proper refactoring (Ctrl-R, O) - I've been using it for a while, and it's amazing! Best, John

        -- LogWizard Meet the Log Viewer that makes monitoring log files a joy!

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups