Created
March 6, 2017 13:34
-
-
Save undeadcat/8fdabab6dc42d0a0d2c3805284c3a189 to your computer and use it in GitHub Desktop.
Compile aspx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Web.Compilation; | |
namespace WebApp | |
{ | |
public class Generator | |
{ | |
public static void Main(string[] args) | |
{ | |
var root = "C:\\dev\\WebForms\\WebForms"; | |
var aspxFile = "about.aspx"; | |
IDictionary dictionary = new Dictionary<string, string>(); | |
var clientBuildManager = new ClientBuildManager("/", root); | |
var virtualPath = "/" + aspxFile; | |
var aspxContent = File.ReadAllText(Path.Combine(root, aspxFile)); | |
var code = clientBuildManager.GenerateCode(virtualPath, | |
aspxContent, | |
out dictionary); | |
Console.WriteLine(code); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment