Git Product home page Git Product logo

source-version's Introduction

SourceVersion.WebForms

SourceVersion is used to provide useful version information harvested from Source Control and then provided at runtime. The primary driver of this project is to make it simpler for developers and testers to accurately know what application build they are interacting with and whether the build is clean or not.

Usage

Add SourceVersion to your WebForms application by doing the following.

  1. Add a reference to SourceVersion.WebForms package via NuGet.
  2. Remove any AssemblyVersion, AssemblyFileVersion or AssemblyInformationalVersion assembly attributes normally found in AssemblyInfo.cs file (AssemblyInfo.fs or AssemblyInfo.vb for F# or VB.NET projects).
  3. Build your project.
  4. Run the project and navigate to Version.ashx in the browser.
{
  "changeset": 1234,
  "serverPath": "$/The/Next/Best/Thing",
  "localPath": "C:\\Users\\fry\\Source\\MyProject",
  "machine": "BUILDSERVER-1234",
  "user": "BUILDSERVER-1234\\fry",
  "hasPendingChanges": true
}

Also notice that when looking at the version information for your assembly that the build portion of the version will be set automatically to the changeset number. Plans are to support additional information here similar to GitVersion.

How does it work

SourceVersion adds specific build targets and properties to the project file and an HTTP Handler to Web.config file

Known limitations

The SourceVersion.WebForms package only works for web applications that target .NET Framework 4.5 and above and that use integrated pipeline to host in IIS 7+. Currently the only source control implementation is TFS and the output contains specific details for TFS workspace. Plans are to support git and perhaps Subversion as well in later versions.

Security consideration

The information disclosed by the Version.ashx handler may be considered sensitive depending on the project. Be aware that by default there is nothing that prevents unauthenticated users from accessing this information.

Contribute

To build open /src/SourceVersion.sln in Visual Studio and build the solution. Packaging and publishing to NuGet.org is currently handled per project such as with SourceVersion.WebForms by using the PowerShell script /src/SourceVersion.WebForms/Package.ps1.

source-version's People

Contributors

jpierson avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

source-version's Issues

Version.ashx only shows TFS version information for root project directory

Using the command tf.exe info . only gives the information about changeset and last modified date with respect to the root directory itself instead the recursive contents of that file. What we probably want in the output is something along the lines of the branch information from tf.exe info and perhaps the most recent change from tf changeset /latest /noprompt.

It appears that we may also not be getting much information about whether the working copy is clean or not so using output from tf status . /recursive may be useful as well.

Related information:

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.