locked
VS 2012 Deployment, Precompiled RRS feed

  • Question

  • User-58016157 posted

    When selecting precompile before publish it publishes great.  However the files in the BIN folder are always different so when copying over to a client they end up with a long list of files.

    I see there is a 'Merge' option in the advanced settings but to be honest I'm not entirely sure what each one does.  Does this affectively let you name the precompiled files so they won't change each time?

    Thursday, August 9, 2012 5:58 AM

Answers

  • User1642585364 posted

    The merge options mostly just a wrapper over the options that can be passed to aspnet_merge.exe, after the site has been precompiled.  Hopefully this will help explain each of the merge options:

    • Merge all outputs to a single assembly: This is the same as the -o option on aspnet_merge.  This will precompile your site and put it all entirely in one assembly. 
    • Merge each individual folder to its own assembly:  This is the same as the -prefix option on aspnet_merge.  It will precompile each directory separately into <prefix>.<directoryName>.dll.
    • Merge all pages and control outputs to a single assembly:  This is the same as the -w option on aspnet_merge.  This will compile all of the UI pages (.aspx, .ascx, .master, etc...) into a single assembly.  This does not include files from App_Code, App_GlobalResources, App_WebReferences, or Global.asax
    • Do not merge.  Create a seprate assembly for each page and control: This uses the -fixednames option on aspnet_compiler.exe.  It does not merge the assemblies, but creates a separate one with a consistent name (based on the path) for each file.
    • Do not merge: This just calls aspnet_precompile but doesn't pass any specific flags in (aside from those in the precompilation settings above the merge options).  The Asp.Net compiler will use its own logic for batching files and creating random looking file names as the outputs.

    The info pages for aspnet_merge and aspnet_compiler are both pretty long, but they give a lot of good information and some scenarios where each option might be desireable.

    [edit:] I should note that if you don't select the option to Make precompiled site be updatable, your views will be compiled by default.  If you do select it, they are excluded from compilation, so that you can update your site (the views at least) without having to recompile and deploy the binaries.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, August 10, 2012 3:30 PM

All replies

  • User-417784260 posted

    If you are precompiling a web site you should delete all the files in the bin folder before deploying the new dlls.  Note if you use a web application instead of a web site your dll name will never change

    Thursday, August 9, 2012 6:22 AM
  • User-58016157 posted

    It's all the controllers and views etc that have different compiled names in the bin.  Does the Merge option not have any effect on this?

    Thursday, August 9, 2012 7:26 AM
  • User1642585364 posted

    The merge options mostly just a wrapper over the options that can be passed to aspnet_merge.exe, after the site has been precompiled.  Hopefully this will help explain each of the merge options:

    • Merge all outputs to a single assembly: This is the same as the -o option on aspnet_merge.  This will precompile your site and put it all entirely in one assembly. 
    • Merge each individual folder to its own assembly:  This is the same as the -prefix option on aspnet_merge.  It will precompile each directory separately into <prefix>.<directoryName>.dll.
    • Merge all pages and control outputs to a single assembly:  This is the same as the -w option on aspnet_merge.  This will compile all of the UI pages (.aspx, .ascx, .master, etc...) into a single assembly.  This does not include files from App_Code, App_GlobalResources, App_WebReferences, or Global.asax
    • Do not merge.  Create a seprate assembly for each page and control: This uses the -fixednames option on aspnet_compiler.exe.  It does not merge the assemblies, but creates a separate one with a consistent name (based on the path) for each file.
    • Do not merge: This just calls aspnet_precompile but doesn't pass any specific flags in (aside from those in the precompilation settings above the merge options).  The Asp.Net compiler will use its own logic for batching files and creating random looking file names as the outputs.

    The info pages for aspnet_merge and aspnet_compiler are both pretty long, but they give a lot of good information and some scenarios where each option might be desireable.

    [edit:] I should note that if you don't select the option to Make precompiled site be updatable, your views will be compiled by default.  If you do select it, they are excluded from compilation, so that you can update your site (the views at least) without having to recompile and deploy the binaries.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, August 10, 2012 3:30 PM