Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to enable roslyn auto-build in my vnext application

I've made demo application to test all new features of asp vNext and Roslyn but I can't reproduce what I saw on presentations: editing controller's viewbag content and refresh the page in order to see the new viewbag, why?

  • I created a vNext project with VS 2015 on my bootcamp (Windows10),
  • Choose the starter web project (with to controllers and some views),
  • Launch the project (start, the play button),
  • go to a view, and see the content,
  • then edit the viewbagin the controller, and SAVE the controller,
  • press F5 on the browser and the content still the same, why?

Roslyn must "re-build" the controller and then If I press f5 I have to see the new content isn't it? Is there an option to activate that feature?

I'm sure this is the viewbag used for the view because when I stop and re-launch the projet, all is OK.

Maybe it's because roslyn is not selected as compiler but vNext needs roslyn in order to run sooo I'm troubled :-)

here is the controller I've edited:

public IActionResult About()
        {
            ViewBag.Message = "Your application description page. coooooool";

            return View();
        }

and the corresponding view:

@{
    ViewBag.Title = "About";
}
<h2>@ViewBag.Title.</h2>
<h3>@ViewBag.Message</h3>

<p>Use this area to provide additional information.</p>

I'm sure this is roslyn because I can put that code in the application without any problem:

string s = nameof(Console.Write);

This is the KVM config:

C:\Program Files (x86)\Microsoft Visual Studio 14.0>kvm list

Active Version     Runtime Architecture Location                       Alias
------ -------     ------- ------------ --------                       -----
       1.0.0-beta1 CLR     amd64        C:\Users\clement\.kre\packages
       1.0.0-beta1 CLR     x86          C:\Users\clement\.kre\packages
       1.0.0-beta1 CoreCLR amd64        C:\Users\clement\.kre\packages
       1.0.0-beta1 CoreCLR x86          C:\Users\clement\.kre\packages
  *    1.0.0-beta2 CoreCLR x86          C:\Users\clement\.kre\packages default

Thanks in advance for your help!

like image 571
clement Avatar asked Jan 25 '15 13:01

clement


2 Answers

Use the start without debugging option (ctrl+F5)

like image 98
kns98 Avatar answered Oct 25 '22 17:10

kns98


As per my experience with this feature that this will not work in debug mode. You can do following thing.

  1. Start site on particular port.

  2. Edit Controller and Save

  3. Refresh the page and it will work.

Note: I have tested this in VS 2015 CTP 5.

like image 24
dotnetstep Avatar answered Oct 25 '22 17:10

dotnetstep