locked
aspnet_compiler syntax RRS feed

  • Question

  • User-252566090 posted

    Hello,

    I am trying to compile part of a web site project which contains large number of html pages, classic asp pages and web forms (aspx, aspx.cs).
    I want to precompile webforms on the development machine using aspnet_compiler.exe, folder by folder basis. Rather than compiling the whole website project (like compiling web application project), I am trying to compile only those web site folders that contain aspx & aspx.cs files, then upload the compiled assemblies, folder by folder to the web server.

    I would like to know what is the correct syntax for precompiling a website application folder C:\Website\FolderA\ and store the compiled assemblies to the folder C:\CompiledAssemblies\FolderA\

    I launched command prompt window, typed the code shown below at c:\Windows\Microsoft.NET\Framework\v4.0.30319> :

    aspnet_compiler -p C:\Website\FolderA C:\CompiledAssemblies\FolderA

    but didn't work.

    I also tried:

    aspnet_compiler -p C:\Website\FolderA -v FolderA

    but also didn't work. In fact I don't know how to create virtual directory for precompiling, I know how to create virtual directories for web application/websites in IIS but I don't know how to do it for this aspnet_compiler.

    Please show me the correct syntax for the aspnet_compiler.exe

    Another question is, if I simply upload the precompiled assemblies to the corresponding website folder of the web server would it work? Would it reduce the initial launching time of the aspx.cs file?



    Thursday, October 17, 2019 12:15 AM

Answers

  • User665608656 posted

    Hi ZKM,

    According to your description, you should change your command like this :

    aspnet_compiler -v \ -p C:\Users\yongqy\source\repos\CaseProject\WebSite_reportview_demo C:\compilerTest

    Here "C:\Users\yongqy\source\repos\CaseProject\WebSite_reportview_demo" is the physical path of your website project. 

    And "C:\compilerTest" is the folder to put precompiled files. You need to make sure it's empty before precompiling.

    You can refer to this official link:  AspNetCompiler task

    Best Regards,

    YongQing.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, October 17, 2019 8:27 AM

All replies

  • User665608656 posted

    Hi ZKM,

    According to your description, you should change your command like this :

    aspnet_compiler -v \ -p C:\Users\yongqy\source\repos\CaseProject\WebSite_reportview_demo C:\compilerTest

    Here "C:\Users\yongqy\source\repos\CaseProject\WebSite_reportview_demo" is the physical path of your website project. 

    And "C:\compilerTest" is the folder to put precompiled files. You need to make sure it's empty before precompiling.

    You can refer to this official link:  AspNetCompiler task

    Best Regards,

    YongQing.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, October 17, 2019 8:27 AM
  • User-252566090 posted

    Thank you for your help, it works! 

    laughing

    Friday, October 18, 2019 12:04 AM