Skip to content

samples Home-dev Console works but not finding HelloMvc and HelloWeb. CTP 6 #442

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ghost opened this issue Apr 7, 2015 · 2 comments
Closed

Comments

@ghost
Copy link

ghost commented Apr 7, 2015

Hi,

I recently downloaded everything (few days ago). Compiles fine, and Console Hello runs fine. The HelloMvc is driving me batty, since I compile and run from 2015 CTP 6 and even the debugger starts, and then, tada, chrome starts and brings not HelloMVC but some standard vNext page "Welcome, your vNext application has been successfully started". Well maybe, but not the one in my Visual Studio :-) And the same happens when I do a dnx . web and enter http://localhost:5001/. Where is my HelloMVC? My Vistual Studio thinks everything is fine...

The project.json file contains references to all sorts of versions, and then I have lots of (different) variants now installed with dnvm (four in all now). This is great flexibility perhaps, but how do I get the matching pieces together? I am not getting any errors, it just doesn't start my HelloMvc no matter which "dnvm use" version I switch to.

Thanks for a tip, since I would love to figure out how to make the correct parts find each other :-)

@magohl
Copy link

magohl commented Apr 7, 2015

You are probably not seeing anything from MVC because the sample HelloMVC on Master is missing a route and you are hitting the static welcome page instead.

Look at the sample in the dev branch (https://github.com/aspnet/Home/tree/dev) which has routes setup in the Startup class. Or simply add a [Route("/")] attribute to the Index() method in the HomeController class and http://localhost:5001/ will make it to MVC.

[Route("/")]
public IActionResult Index()
{
    return View(User());
}

@ghost
Copy link
Author

ghost commented Apr 8, 2015

Well this is a lesson not ever to take something for granted :-) even if it has been around since MVC 1.0! I was trying all the default-routes and checked the controller about 10 times but never came across the idea than maybe there are no more default routes at all! I think this may be something that should be added to the demo or at least the documentation. Thanks again!

@ghost ghost closed this as completed Apr 8, 2015
ryanbrandenburg pushed a commit that referenced this issue Nov 22, 2018
@ghost ghost locked as resolved and limited conversation to collaborators Jun 1, 2021
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant