Search code examples
visual-studio-2013visual-studio-2005nant

Web Application deployment using nant scripts not happening using vs 2013 command prompt


I was using VS2005 previously for two web applications and was deploying the applications using vs2005 cmd prompt. But I recently migrated to VS2013 and the same nant scripts commands are not working fine when I execute them using vs2013 cmd prompt. I'm getting the below error message in at the time when it fails

External Program Failed: aspnet_compiler.exe (return code was 1)

Can somebody please help me out with this thing. One application says successfull but when I open the application using the url it says page not found.


Solution

  • aspnet_compiler will compile all the views (*.aspx, *.ascx, *.cshtml, etc). It's roughly akin to running each page and validating it renders correctly. This is a great way to validate all your pages are free from hard-to-find run-time errors. Since aspnet_compiler ran, the issue isn't that it isn't in the path. It may be that it's using VS 2005's aspnet_compiler or from a different framework version, but that's less likely. More likely is that you have a syntax error in a page or user control. Look at the build output around the "return code was 1" message and find the additional detail about the page and line that is failing.

    Another not-recommended option is to comment out the aspnet_compiler line from your nant file, but you then lose all the benefits of this precompilation / validation.