NH.beginner246
NH.beginner246

Reputation: 11

How to programmatically publish asp.net web app using aspnet_compiler.exe

I am learning how to automate the solution building, publishing, and deploying of ASP.NET websites. I am only using C# to execute cmd commands programatically, and I'm currently stuck with the publish process.

I have tried MSBuild but the output is not compiled the same as the aspnet_compiler files (dll is outside the bin folder and it creates an additional sub-folder). I recently noticed that VS used aspnet_compiler.exe in the publishing process but I don't know the backend process of how the obj\Release\AspnetCompileMerge\Source folder populates.

aspnet_compiler.exe -v / -p "C:\Users\*SolutionPath*\obj\Release\AspnetCompileMerge\Source" 
                    -u -c "C:\Users\*SolutionPath*\obj\Release\AspnetCompileMerge\TempBuildDir" 

From my understanding this command I saw in the output box in VS is responsible for pre-compiling the files from the Source folder to TempBuildDir folder then it copies those files to your chosen publish file folder.

Upvotes: 1

Views: 94

Answers (0)

Related Questions