Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET vNext - compile code dynamically not working for me

Tags:

asp.net-core

I've run through the tutorial on this here: http://www.asp.net/vnext/overview/aspnet-vnext/getting-started-with-aspnet-vnext-and-visual-studio

I am following step 7 in section 2 - "With the browser still open, open Class1.cs and change the message text to "New message from ClassLibrary1!".

Unfortunately after making the code change, when I refresh the browser it is the same a before. I have to recompile for the change to take effect.

Any ideas why? I want to see the magic happen!

Windows 7 64bit Microsoft Visual Studio Professional 14 CTP Version 14.0.21730.1 DP Microsoft .NET Framework Version 4.5.50938

project.json:

{
    "dependencies": {
        "Helios": "0.1-alpha-build-0585",
        "Microsoft.AspNet.Mvc": "0.1-alpha-build-1268",
        "Microsoft.AspNet.Identity.Entity": "0.1-alpha-build-1059",
        "Microsoft.AspNet.Identity.Security": "0.1-alpha-build-1059",
        "Microsoft.AspNet.Security.Cookies": "0.1-alpha-build-0506",
        "Microsoft.AspNet.Server.WebListener": "0.1-alpha-build-0520",
        "Microsoft.AspNet.StaticFiles": "0.1-alpha-build-0443",
        "Microsoft.Data.Entity": "0.1-alpha-build-0863",
        "Microsoft.Data.Entity.SqlServer": "0.1-alpha-build-0863",
        "Microsoft.Framework.ConfigurationModel.Json": "0.1-alpha-build-0233",
        "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0-alpha",
        "Classlibrary1": ""
    },
    "commands": {
        /* Change the port number when you are self hosting this application */
        "web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5000"
    },
    "configurations": {
        "net45": {
            "dependencies": {
                "System.Data": "",
                "System.ComponentModel.DataAnnotations": ""
            }
        },
        "k10": {
        }
    }
}

Paul

like image 899
P2l Avatar asked Jun 06 '14 12:06

P2l


2 Answers

You are probably running with the debugger attached. The file watcher doesn't work with the debugger attached. Why? Long story short: IIS (express) is restarted to pick up assembly changes, so that would not work with the debugger attached because it would kill your debugging session.

Start the website without debugging, then change a code file and refresh - magic happens.

Later edit: To start the application wihtout debugging either use Ctrl + F5 or Debug -> Start without debugging

like image 86
Victor Hurdugaci Avatar answered Oct 08 '22 17:10

Victor Hurdugaci


It seems, that this is a know issue, that will hopefully get fixed later https://github.com/aspnet/Home/issues/22

like image 39
Lukas Kabrt Avatar answered Oct 08 '22 17:10

Lukas Kabrt