Menu

Get an exception while trying to exec. a task

Help
2004-12-27
2013-04-08
  • Ralf J. Schumacher

    I get an exception while trying to execute a task in the NAntRunner pane inside VS2003.The Exception is a Win32Exception and says "The system can't find the specified path".Which path?I doublechecked the NAnt-path in the options.

     
    • Nicolas Puzin

      Nicolas Puzin - 2005-04-29

      Check in the NAntRunner options if the NAnt specified path is correct (menu Tools/Options/NAntRunner)

       
      • Chuck Woods

        Chuck Woods - 2005-05-03

        Cool.  The only problem is that putting the build file in the solution isn't really the most organized way to set up a project.  So since we don't organize our projects this way, we can't use this cool tool.  Is there any way it could handle being configurable so that the build file can be placed in another directory.  If the source is up to date, I might get a chance to make this enhancement and submit it.

         
    • Chuck Woods

      Chuck Woods - 2005-05-02

      Thanks, that worked.  Now I can access the NantRunner panel.  The only problem now is that it can't seem to find my build file.  Is it expecting it in a particular directory, or is this configurable in some panel that I'm not seeing?  I see that I can configure the location of the nant.exe, but adding the -buildfile option doesn't seem to help find the build file. 

      Again, your input is appreciated.  The screenshots of the tool looks great and I'm sure it works great.  I think that the basic thing that we're missing is a readme file that specifies how to basically setup and configure the tool.

      Thanks again

       
    • Nicolas Puzin

      Nicolas Puzin - 2005-05-02

      You just need to include your buildfiles in your project or in your solution and your buildfiles targets will appear in the NAntRunner tab. You will need maybe to click on the refresh icon.

       
    • Craig Fleming

      Craig Fleming - 2005-05-03

      I have my build file in the project directory and it refreshes fine.

      How are you organizing your projects/solutions?

       
    • Chuck Woods

      Chuck Woods - 2005-05-04

      We keep things in separate places under source control.  One solution per repository.

      -build (contains build and deploy related files)
      -distribution (contains the distribution ready artifacts; .exe & .dll)
      -documentation (ndocs and design artifacts)
      -examples (contains proof of concept stuff and related garbage)
      -references (referenced assemblies)
      -source (contains all of the projects/source/SQL related to the solution)
      -tools (contains tools used by the build process and tools suggested/approved for developer usage)

      There are more subfolders within these, but I won't bore you.  I'm not claiming that this is the "right" way to organize things, but its a hybrid of the most organized approaches that I have seen.

      Either way, Nantrunner shouldn't assume that the build file is sitting in the project directory since one of the purposes of Nant is to provide flexibility to structure things in a way that makes sense for your development efforts.  Therefore, if Nantrunner makes more assumptions than Nant does, you've just limited yourself by deciding to use Nantrunner.

       
    • Nicolas Puzin

      Nicolas Puzin - 2005-05-06

      If you add your build file as an "Solution Item" (right click on your VS solution / Add / Add existing item), your build file can be located anywhere. I believe that this is what you want, no ?

       
    • Chuck Woods

      Chuck Woods - 2005-05-09

      That works perfectly.  Thanks for the pointer.

       
    • Klaus Luedenscheidt

      I also get this exception after installing Version 1.1. I'm using a German WIndows XP and didn't use the default path foer installation.

      Regards
      Klaus

       
    • Nicolas Puzin

      Nicolas Puzin - 2005-06-14

      If you don't use the default NAnt path, you can modify that in the options in Visual Studio (Tools/Options/Nant Runner)

       
    • Klaus Luedenscheidt

      This was the first i have done. The problem is still there

       
      • kiwidude

        kiwidude - 2005-09-13

        I too get this same error - and yes I have checked my NAnt.exe path in the options dialog (I used the default paths during installations of both NAnt and NAntRunner).

        This is really frustrating as it looks to be a useful tool - can anyone please shed some light on this? I'm using VS.Net 2003 and NAntRunner 1.1. I have tried locating the .build file in both the project and solution directories - the add-in window picks up the file ok after a refresh as it lists all the tasks - but get this error regardless.

         
      • threadz

        threadz - 2005-09-20

        I get the same too:...

        "The following exception has occurred:

        Win32Exception: The system cannot find the path specified"

        I have NAntRunner 1.1 (installed into C:\Program Files\NAntRunnerAddIn) and Nant (installed into C:\Program Files\nant).  Trying to use it with  VS2003.

        In the Tools | Options dialog in VS I have the NAnt Executable as C:\Program Files\nant\bin\NAnt.exe

        I have the NAntRunner tab with the targets displayed ok but whenever I try to run one of them I get the error above.  :-(

         
      • threadz

        threadz - 2005-09-20
         
    • kiwidude

      kiwidude - 2005-09-21

      threadz you legend - that does indeed do the trick. Grrr - hard-coded paths! The problem wasn't so much the "Program Files" portion (since I have an English install) but the actual name of the VS.Net installation folder. At our company for whatever reason the packaging team changed it to a slightly different name. I modified NAntRunner to make the "VS.Net Tools" path an option in the Tools->Options->NAntRunner window and modified NAntRunner.cs as per that other thread's instructions (re double quotes) and to use this path from the config - works sweet...

       
    • Jim Shank

      Jim Shank - 2005-09-22

      Thanks threadz, modified line 92~104 as follows:

      string spawnArgs = " -e " + stopEvent.Handle;
                      spawnArgs += " " + Environment.GetEnvironmentVariable("WINDIR") + @"\system32\cmd.exe" + " /k \"echo off&&\"";
                      spawnArgs += Path.Combine(Environment.GetEnvironmentVariable("VS71COMNTOOLS"), "vsvars32.bat");
                      spawnArgs += "\"";
                         
                      spawnArgs += "&&echo " + "--NANT_BEGIN_TAG--";
                      spawnArgs += "&&\"" + conf.NAntExe + "\" " + conf.CmdLineArgs + " " + targetProps +
                          " /f:\"" + target.Build.FileName + "\" " + target.Name;
                 
                      spawnArgs += "\"";

                      ProcessStartInfo Info = new ProcessStartInfo();
                      Info.FileName = Path.Combine(Environment.GetEnvironmentVariable("VS71COMNTOOLS"), "vcspawn.exe");
                 
      Since VS71COMMONTOOLS points to the right directory. Hopefully will be fixed in next revision.

       
    • Nicolas Puzin

      Nicolas Puzin - 2005-10-13

      Indeed that's really a stupid bug, I will correct that in our next release.

      If you have ideas to improve NAntRunner, some new functionalities for example, don't hesitate to start a thread in this forum to propose your ideas.

       
    • Craig Boland

      Craig Boland - 2005-12-15

      Using Environment.GetEnvironmentVariable("ComSpec") may be a more reliable method of getting the full path to cmd.exe. On my XP machine, the ComSpec variable has a value of C:\WINDOWS\system32\cmd.exe.

       

Log in to post a comment.