Giter Site home page Giter Site logo

wzj88123 / stackexchange.precompilation Goto Github PK

View Code? Open in Web Editor NEW

This project forked from stackexchange/stackexchange.precompilation

0.0 0.0 0.0 3.16 MB

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

License: MIT License

PowerShell 1.22% C# 95.60% Smalltalk 0.01% HTML 3.18%

stackexchange.precompilation's Introduction

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

Using C# 7 in ASP.NET MVC 5

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

stackexchange.precompilation's People

Contributors

m0sa avatar rossipedia avatar 0x53a avatar daniilsokolyuk avatar maboivin avatar matthewsteeples avatar natehitze avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.