Community
    • Login

    Compile C# from NPP

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    7 Posts 3 Posters 6.7k Views
    Loading More Posts
    • 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.
    • Jawz FerocityJ
      Jawz Ferocity
      last edited by

      Hey guys, I’ve been fixated on this problem to the detriment of my other pursuits. I am trying to compile my c# code from npp using this guide… (https://dzone.com/articles/notepad-c-compiler-you-can-do)

      When I do Run>run the message I get in cmd is that the source file cannot be found and a warning 2008 that no source has been specified. I’ve double checked and the .cs files are present in the folder I list in the path. Please Help

      Claudia FrankC 1 Reply Last reply Reply Quote 0
      • Claudia FrankC
        Claudia Frank @Jawz Ferocity
        last edited by

        @Jawz-Ferocity

        it might be that a space in the file path is breaking this,
        did you try to encase $(FULL_CURRENT_PATH) in double quotes?
        “$(FULL_CURRENT_PATH)”

        If this doesn’t help submit what you put into run menu and where your files are.
        In addition, I would recommend using nppexec instead of run menu anyway.

        Cheers
        Claudia

        1 Reply Last reply Reply Quote 0
        • Jawz FerocityJ
          Jawz Ferocity
          last edited by

          thanks for your help, this is what I input:
          cmd /k csc.exe “$(C:\Users\user1\Documents\MyFiles\sample.cs)”

          Claudia FrankC Scott SumnerS 2 Replies Last reply Reply Quote 0
          • Claudia FrankC
            Claudia Frank @Jawz Ferocity
            last edited by

            @Jawz-Ferocity

            the $ is only needed if a variable needs to be expanded not if you provide the path manually.

            Cheers
            Claudia

            1 Reply Last reply Reply Quote 0
            • Scott SumnerS
              Scott Sumner @Jawz Ferocity
              last edited by

              @Jawz-Ferocity

              Perhaps the best way to explain it so that it is understood is that instead of doing

              cmd /k csc.exe “$(C:\Users\user1\Documents\MyFiles\sample.cs)”

              You should do

              cmd /k csc.exe “C:\Users\user1\Documents\MyFiles\sample.cs”

              Make sure that works, then change it to how you really should do it, and that is, have your file – C:\Users\user1\Documents\MyFiles\sample.cs – active in an editor tab, and then invoke exactly this:

              cmd /k csc.exe “$(FULL_CURRENT_PATH)”

              1 Reply Last reply Reply Quote 1
              • Jawz FerocityJ
                Jawz Ferocity
                last edited by

                That did it, thanks Claudia :-)

                1 Reply Last reply Reply Quote 0
                • Jawz FerocityJ
                  Jawz Ferocity
                  last edited by

                  @Scott-Sumner said:

                  Perhaps the best way to explain it so that it is understood is that instead of doing

                  cmd /k csc.exe “$(C:\Users\user1\Documents\MyFiles\sample.cs)”

                  You should do

                  cmd /k csc.exe “C:\Users\user1\Documents\MyFiles\sample.cs”

                  Make sure that works, then change it to how you really should do it, and that is, have your file – C:\Users\user1\Documents\MyFiles\sample.cs – active in an editor tab, and then invoke exactly this:

                  cmd /k csc.exe “$(FULL_CURRENT_PATH)”

                  TY guys I’m up and running.

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post
                  The Community of users of the Notepad++ text editor.
                  Powered by NodeBB | Contributors