c# - Where do pages and user controls end up when you precompile but not merge? -
c# - Where do pages and user controls end up when you precompile but not merge? -
when publishing website have several precompile options. example, let's assume it's .ascx user command (though page behavior similar) , "allow precompiled site updatable" not checked. these of options have:
don't precompile: user command content stays in .ascx file , compiled on demand temporary asp.net folders. precompile, no merge: main dll (projectname.dll) different, .ascx disappears, , can't find ascx content anywhere?? precompile, merge single assembly: main dll different, .ascx content in new single assembly, , .compiled files appear precompile, merge pages , controls single assembly: identical #3, single assembly smaller (presumably doesn't include top-level assemblies) of code #3 included)same #3 have .compiled files.methodology: used winmerge compare publish output between #1 , #2, #2 , #3 , on. picked unique word 1 ascx , searched publish output using agent ransack (finds everything, not indexed content).
question: #2, user command html content end up? or in other words, how site work without published ascx content in dll or without .compiled files? #1 picks content .ascx needed, #2 doesn't have availaible.
edit: site went readonly right after asked , realized build output invalid. have updated question more accurate , thorough.
it ends in produced .dll in published bin folder 1 way or another
.aspx , .ascx files produce command object trees strings between %>aaa<% beingness converted literal("aaa") , inserted command tree @ right places.
these classes descendant page (or base of operations page class of choice) , webusercontrol compiled without precompilation reside in temporary asp.net folders; pre-compilation placed within precompiled bundle right away.
for illustration next .ascx
<%@ command language="c#" autoeventwireup="true" codefile="webusercontrol.ascx.cs" inherits="webusercontrol" %> <div class="customhtml"> <asp:label id="label1" runat="server" text="<%#page.title %>"></asp:label> <asp:button id="button1" runat="server" text="button" /> </div>
results in next (option no merge): webusercontrol.ascx.#hash#.compiled
<?xml version="1.0" encoding="utf-8"?> <preserve resulttype="3" virtualpath="/website1/webusercontrol.ascx" hash="fffffff7f6e43006" filehash="8f74adc78f7714d1" flags="110000" assembly="app_web_aslslubn" type="asp.webusercontrol_ascx"> <filedeps> <filedep name="/website1/webusercontrol.ascx" /> <filedep name="/website1/webusercontrol.ascx.cs" /> </filedeps> </preserve>
that allows find assembly compiled - app_web_#hash# , type - asp.webusercontrol_ascx
disassembling shows next class declaration:
using system; using system.diagnostics; using system.globalization; using system.web.ui; using system.web.ui.webcontrols; namespace asp { public class webusercontrol_ascx : webusercontrol { private static bool __initialized; [debuggernonusercode] public webusercontrol_ascx() { this.apprelativevirtualpath = "~/webusercontrol.ascx"; if (webusercontrol_ascx.__initialized) return; webusercontrol_ascx.__initialized = true; } [debuggernonusercode] private label __buildcontrollabel1() { label label = new label(); this.label1 = label; label.applystylesheetskin(this.page); label.id = "label1"; label.databinding += new eventhandler(this.__databindinglabel1); homecoming label; } public void __databindinglabel1(object sender, eventargs e) { label label = (label) sender; command bindingcontainer = label.bindingcontainer; label.text = convert.tostring(this.page.title, (iformatprovider) cultureinfo.currentculture); } [debuggernonusercode] private button __buildcontrolbutton1() { button button = new button(); this.button1 = button; button.applystylesheetskin(this.page); button.id = "button1"; button.text = "button"; homecoming button; } [debuggernonusercode] private void __buildcontroltree(webusercontrol_ascx __ctrl) { iparseraccessor parseraccessor = (iparseraccessor) __ctrl; parseraccessor.addparsedsubobject((object) new literalcontrol("\r\n<div class=\"customhtml\">\r\n ")); label label = this.__buildcontrollabel1(); parseraccessor.addparsedsubobject((object) label); parseraccessor.addparsedsubobject((object) new literalcontrol("\r\n ")); button button = this.__buildcontrolbutton1(); parseraccessor.addparsedsubobject((object) button); parseraccessor.addparsedsubobject((object) new literalcontrol("\r\n</div>\r\n")); } [debuggernonusercode] protected override void frameworkinitialize() { base.frameworkinitialize(); this.__buildcontroltree(this); } } }
in particular can find html code literalcontrol beingness addedd
[debuggernonusercode] private void __buildcontroltree(webusercontrol_ascx __ctrl) { iparseraccessor parseraccessor = (iparseraccessor) __ctrl; parseraccessor.addparsedsubobject((object) new literalcontrol("\r\n<div class=\"customhtml\">\r\n ")); label label = this.__buildcontrollabel1(); parseraccessor.addparsedsubobject((object) label); parseraccessor.addparsedsubobject((object) new literalcontrol("\r\n ")); button button = this.__buildcontrolbutton1(); parseraccessor.addparsedsubobject((object) button); parseraccessor.addparsedsubobject((object) new literalcontrol("\r\n</div>\r\n")); }
c# aspnet-compiler aspnet-merge
Comments
Post a Comment