Trying to Build and Publish Asp.net website from command line using aspnet_compiler

grobartn picture grobartn · Jun 11, 2009 · Viewed 7.2k times · Source

I am trying this. I have built asp.net website. When I publish to IIS through VS2008 it works fine. Lets say my site is at c:\projects\Website1\ I want to publish it to c:\Inetpub\wwwroot\WebsiteOne

I am trying to mimic publish from studio. That is publish and remove anything that is in side.

I tried this: aspnet_compiler -v/WebsiteOne -f c:\Inetpub\wwwroot\WebsiteOne

Error: error ASPRUNTIME: The precompilation target directory (c:\Inetpub\wwwroot\WebsiteOne) cannot be in the same tree as the source application directory (c:\inetpub\wwwroot\WebsiteOne).

When I tried this: aspnet_compiler -v/WebsiteOne

I get error This application is already precompiled.

Anyone who could give me an insight on how to do compile line building and publishing of website

Thanks

Answer

grobartn picture grobartn · Jul 8, 2010

I solved the problem in meantime. You just need to pass the physical path, because it picks up one from IIS

aspnet_compiler -v /WebsiteOne -p c:\projects\Website1 -f c:\Inetpub\wwwroot\WebsiteOne 

in case someone else encountered same problem..