I'm trying to write a build system for a website so that I can do a one click build. I'm getting a clean copy of the code from the source code repository and then using msbuild to run a AspNetCompiler task to do all the precompile for the website.
The thing that is confusing me is that I need to specify a VirtualPath or MetabasePath. I don't have a metabase path - I want to just compile it into a local directory that can then be deployed to whatever servers are chosen (ie dev servers first then live servers later).
VirtualPath is tricky because I want the same code to be deployable into multiple locations - the code uses some context and configuration details to work out its SiteID to display different info - so specifying a single virtual path doesn't seem wise.
There are various other questions out there along a similar line (eg VirtualPath in AspNetCompiler MSBuild Task - does it have to be equal to the final deployed Virtual Path? ) but the only answers I've found seem to be more anecdotal - ie they jsut say it seems to make no difference in their experience.
However, I can't believe that it really makes no difference. There must be some situation in which this is used or else it wouldn't be there and wouldn't be required.
So does anybody know (and preferably have a reference) for what this does? What problems might be caused by passing a made up virtual path into the task?
When publishing a site in Visual Studio, it is not required to enter this data (in fact, I have never even seen any option to). I'm surprised it is mandatory in an MS-Build configuration.
You might want to "reverse engineer" whatever Visual Studio uses but my guess is it will be a single slash "/" or something like that.
Having said that, the requirement might have something to do with the issues around precompiled websites using Virtual Path Providers or Resource Providers.
Visual Studio uses a single backslash for the VirtualPath property. The full command line string that is generated looks something like this.
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe -v \ -p C:\src\Web\WebApplication1\obj\Release\AspnetCompileMerge\Source C:\src\Web\WebApplication1\obj\Release\AspnetCompileMerge\TempBuildDir
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With