I\'m working on a website that I\'d like to use in-place compilation on in order to make the first hit faster. I\'d like to use the ClientBuildManager.CompileFile method to do
Sam, the answer is a cross between David Ebbo's answer, and your original code.
var buildParameter = new ClientBuildManagerParameter
{
PrecompilationFlags = PrecompilationFlags.Default,
};
var clientBuildManager = new ClientBuildManager(
RootVirtualPath, RootPhysicalPath, null, buildParameter);
...
clientBuildManager.CompileFile(relativeVirtualPath, callback);
If you do what David Ebbo said and use this for the RootVirtualPath when constructing the ClientBuildManager:
/LM/W3SVC/7/ROOT/
you then have to pass in null for the RootPhysicalPath.
That should get rid of the rest of the issues, and it should build to the same directory that IIS is looking for.