GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - StackExchange/StackExchange.Precompilation: Roslyn based csc.exe and aspnet_compiler.exe replacement with metaprogramming hooks for ASP.NET MVC projects from the pre-DNX era

BranchesTags
Open more actions menu

Latest commit

 

History

249 Commits
249 Commits

Folders and files

NameName
Last commit message
Last commit date
StackExchange.Precompilation.Build
StackExchange.Precompilation.Build
 
 
StackExchange.Precompilation.Tests
StackExchange.Precompilation.Tests
 
 
StackExchange.Precompilation
StackExchange.Precompilation
 
 
StackExhcange.Precompilation.MVC5
StackExhcange.Precompilation.MVC5
 
 
Test.ConsoleApp
Test.ConsoleApp
 
 
Test.Module
Test.Module
 
 
Test.WebApp.ExternalViews
Test.WebApp.ExternalViews
 
 
Test.WebApp
Test.WebApp
 
 
.gitignore
.gitignore
 
 
BuildAndPack.ps1
BuildAndPack.ps1
 
 
Directory.Build.props
Directory.Build.props
 
 
README.md
README.md
 
 
Release.ps1
Release.ps1
 
 
StackExchange.Precompilation.sln
StackExchange.Precompilation.sln
 
 
appveyor.yml
appveyor.yml
 
 
license.txt
license.txt
 
 
semver.txt
semver.txt
 
 

Repository files navigation

StackExchange.Precompilation

Build status

Replacing csc.exe

  • Install-Package StackExchange.Precompilation.Build -Pre

Replacing aspnet_compiler.exe for .cshtml precompilation

  • Install-Package StackExchange.Precompilation.Build -Pre
  • Add <PropertyGroup><SEPrecompilerIncludeRazor>true</SEPrecompilerIncludeRazor></PropertyGroup> to your .csproj file (usually replacing the MvcBuildViews property)

Using precompiled views

  • Add the PrecompiledViewEngine to ViewEngines

Using C# 7 in ASP.NET MVC 5

  • Add the RoslynRazorViewEngine to ViewEngines

Meta-programming

  • Create a new project
  • Install-Package StackExchange.Precompilation -Pre
  • Implement the ICompileModule interface
  • Install-Package StackExchange.Precompilation.Build -Pre in the target project
  • Configure your new module in the target project's web.config or app.config

Development

if you have an existing project with StackExchange.Precompilation packages and encounter a bug you can simply:

  • pull this repo
  • increment semver.txt
  • make the fix in the source code
  • run BuildAndPack.ps1 (requires a console with VS env vars in your PATH, I recommend powershell with Posh-VsVars)
  • setup a nuget source pointing at .\packages\obj
  • after that you can update the packages StackExchange.Precompilation in your target project from the packages\obj source
  • this gives you local *-local{timestamp} suffixed packages instead of the *-alpha{build} ones produced by the CI build
  • PROTIP: if you want to attach an debugger to the compilation of your project or any of the Test.* projects, add a System.Diagnostics.Debugger.Launch() statement somewhere in the code ;)
  • CI *-alpha{build} packages are available on the stackoverflow myget feed https://www.myget.org/F/stackoverflow/api/v2

About

Roslyn based csc.exe and aspnet_compiler.exe replacement with metaprogramming hooks for ASP.NET MVC projects from the pre-DNX era

Resources

Readme
MIT license
Activity
Custom properties

Stars

161 stars

Watchers

34 watching

Forks

40 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.