Last post Oct 18, 2019 12:04 AM by ZKM128
Oct 17, 2019 12:15 AM|ZKM128|LINK
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?
Oct 17, 2019 08:27 AM|Yongqing Yu|LINK
According to your description, you should change your command like
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
Oct 18, 2019 12:04 AM|ZKM128|LINK
Thank you for your help, it works!