Note that there are some explanatory texts on larger screens.

plurals
  1. POVirtualPath in AspNetCompiler MSBuild Task - does it have to be equal to the final deployed Virtual Path?
    primarykey
    data
    text
    <p>This is VS 2008 and .Net 3.5.</p> <p>I use a custom deployment project script which is similar to the publish right-click menu, but which I have customised to do file renaming and various other bits and pieces. It works really well and has drastically simplified the release procedure.</p> <p>I was made aware of an issue on one of our live sites this weekend that would have been prevented had the site been precompiled (long story).</p> <p>So I've been playing around with injecting the AspNetCompiler MSBuild Task (using the PhysicalPath attribute to direct towards the intermediate publish folder) into the deployment script and I have a question regarding the 'VirtualPath' option.</p> <p>Despite the fact that the website is not in IIS at this pre-deploy stage, you are still required to provide a value for the 'VirtualPath' attribute. I have seen <a href="http://odetocode.com/Articles/417.aspx" rel="nofollow noreferrer">here</a> that the associated -v switch on aspnet_compiler.exe uses this value in resolving '~' rooted virtual paths used throughout the site during the compilation.</p> <p>So, I take this to mean that whatever you pass here <strong>must</strong> be the virtual root of the application when deployed otherwise it won't work. </p> <p>However, I've tried this out, passing something like '/fake/fake' in this option and then changing one of my master pages to reference a css via an app-rooted url instead of relative, and it still worked even when deployed to a virtual path of '/site' and not '/fake/fake'.</p> <p>So what's the definitive answer on this? Do I need to worry about this VirtualPath value being exactly equal to the eventual deployed location of a site in IIS? I hope not, because I don't really want my deploy project to have any knowledge of the virtual hierarchy of the target web server, in case it needs to change.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload