asp.net-mvc-3google-chrome-devtoolslivereload

Tincr for ASP.NET MVC 3


I am trying to use the tincr extension in Chrome. It allows you to refresh CSS and JavaScript without having to reload the page again. I'm having some trouble getting it working.

My Setup

Source code root directory: C:\dev\tfs\MyApp\Development Branches\3.3.0.0\Presentation\MyApp.

IIS website directory points to the root directory above. The Scripts directory underneath the folder path above contains the js files that I am changing.

I created a tincr.json file and put it in the root directory

tincr.json

{
    "toFile" : [],
    "fromFile" : [
        {"from": "C:\\\\dev\\\\tfs\\\\MyApp\\\\Development Branches\\\\3.3.0.0\\\\Presentation\\\\MyApp\\\\Scripts\\\\(.+\\.js)",
         "to": "http://localhost/MyApp/Scripts/$1"}
    ]
}

Is this correct? How can I get tincr working with ASP.NET MVC 3?


Solution

  • After playing around and reading google groups and other web sites I pieced together the following

    I put a more detailed how to for Tincr on my website http://aboutdev.wordpress.com/2013/01/26/using-tincr-with-asp-net-mvc-in-windows-7/ but here is what you need.

    The tincr.js file I used looks as follows:

    {
        "toFile" : [],
        "fromFile" : 
        [
            {
                "from": "\\\\Scripts\\\\([a-zA-Z]+)\\.js",
                "to": "/MyApp/Scripts/$1.js"
            }
        ]
    }
    

    This file does not update the file on disk because 'tofile' is not filled in. This file will look for files in the Scripts directory that is directly under the root where you put your tincr.json file.

    I hope this helps you with using Tincr in your pojects.