Attempting to create and publish an Asp.net website from the command line using aspnet_compiler

I am trying to do this. I created an asp.net website. When I publish to IIS through VS2008, it works fine. Suppose my site is located in c: \ projects \ Website1 \ I want to publish it in c: \ Inetpub \ wwwroot \ WebsiteOne

I am trying to imitate publishing from a studio. This is to publish and delete everything that is on the side.

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

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

When I tried this: aspnet_compiler -v / WebsiteOne

I get an error. This application has already been precompiled.

Anyone who could give me an idea on how to do a string assembly and publish a website

thanks

+4
source share
3 answers

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

aspnet_compiler -v/WebsiteOne -pc:\projects\Website1 -fc:\Inetpub\wwwroot\WebsiteOne 

if someone else is faced with the same problem.

+4
source

Alternatively, you can use MSBuild in your decision file and use the publish target.

What VStudio does under the covers anyway. :-)

+1
source

From http://johnnycoder.com/blog/2008/01/29/getting-started-with-cruisecontrolnet/

I inserted this information if his blog ever goes down.

  • For web solutions, upgrade the TargetPath application to debug and / or release the application outside the source application directory. Otherwise, you will receive the following error:

ASPNETCOMPILER: ASPRUNTIME error: The target compilation directory cannot be in the same tree as the application source directory.

This can be done by changing the following in the solution file:

 Debug.AspNetCompiler.TargetPath = "c:\ccnet\PrecompiledWeb\SampleWeb\" Release.AspNetCompiler.TargetPath = "c:\ccnet\PrecompiledWeb\SampleWeb\" 

Alternatively, you can update the output location found in the properties of the MSBuild application.

You might be wondering why the updated solution will not be updated with the next scheduled build. Since this works (and makes sense), only the changes that apply to source control are pulled to the assembly block.

0
source

Source: https://habr.com/ru/post/1286089/


All Articles