Closed mdmoura closed 7 years ago
Hi,
I'm afraid not yet. Are you already developing applications with Asp.Net VNext? When will it be released?
I plan to look over this at end of June / begin of July.
Hello,
I am developing my first application with ASP.NET VNext ...
Windows 10 will be released, if I am not mistaken, on 29 of July. Visual Studio 2015 RC was released in May including ASP.NET VNext Beta 5. I suppose Visual Studio 2015 and ASP.NET VNext will be launched along Windows 10.
What do you think?
ASP.NET team decided to go for a Beta 6 where 22% is completed: https://github.com/aspnet/Mvc/milestones
On ASP.NET VNext MVC and Web API Controllers were unified in only one. So I suppose there would be only one RouteLocalization library for VNext.
You can use Attribute Routing and Convention routing as usual ... But if you don't use any, the routes are generated from controllers automatically.
Yeah I never found any official statements but I think July / August will be likely.
I guess there will be only one library, which will make further development easier but I don't know how much changes will be required to make it work for vNext.
But if you don't use any, the routes are generated from controllers automatically.
Interesting. Do you have more information about how this works?
I read that information about automatically creating routes in: http://stephenwalther.com/archive/2015/02/07/asp-net-5-deep-dive-routing
Check down the article:
First, in ASP.NET 5, there is no longer a distinction between MVC and Web API controllers. Both MVC and Web API controllers derive from the very same Controller base class.
This means that the same routing framework is used for both MVC and the Web API. With ASP.NET 5, anything that is true of routing for MVC is also true for the Web API.
Second, unlike earlier versions of MVC, default routes are created for you automatically. You don’t need to configure anything to route a request to a controller action. A set of default routes is created for you automatically.
I also read the following which goes in more detail: http://blogs.msdn.com/b/webdev/archive/2014/06/20/asp-net-vnext-routing-overview.aspx
He talks about ASP.NET VNext routing being built as a Component Middleware ... So I believe it might be simpler to integrate RL in it and future development.
In ASP.NET vNext, Routing is built as a middleware component that can be added to the request pipeline.
And the source, which seems pretty stable and finished, is here: https://github.com/aspnet/Routing
I recently installed the Visual Studio 2015 RC and played around with the current MVC6 project template. They changed a lot within the framework and it seems that there is no DirectRouteProvider
anymore which was used in the current RouteLocalization for intercepting attribute routes.
They added an ApplicationModel which can be used to add / modfiy existing attribute routes (see here), but I don't think that this will be enough to add the current functionality.
I'll have to think about it and look for other possibilities.
I am not sure about it but couldn't this be done through a middleware: http://www.mikesdotnetting.com/Article/269/asp-net-5-middleware-or-where-has-my-httpmodule-gone
BTW about ASP.NET MVC 6 timings are different from what I though:
Beta 6, end of July.
Beta 7, end of August.
Beta 8, end of September. Tentative.
RC, november. Very tentative.
RTM, early 2016.
This was a video that was released recently: https://www.youtube.com/watch?v=vqTGJGy3D9s#t=13m18
And how would you design this middleware or what should it do?
I doesn't seem that there is an easy way to integrate RouteLocalization for Asp.Net 6. I opened an issue in the aspnet github repository anyway to clarify that.
I will try to use the IApplicationConvention approach (it seems it is the only possibility anyway), but we have to see how much functionality can be implemented with the new system. Any help on that topic is appreciated.
Hi Dresel, sorry for the delay ... I have been overwhelmed with work.
I was reading Ryan Nowak answer to your issue in Github ... In NameSpaceRoutingConvention they are doing a simple replacing.
What is your idea of how to do route replacing in the convention?
And BTW what features do you think can be integrated with ASP.NET MVC 6 and cannot?
Hi Dresel,
I have been reading this post on Route Localization: http://www.strathweb.com/2015/11/localized-routes-with-asp-net-5-and-mvc-6/
It relies on the Route Name which I think it could be avoidable ...
And it defines a LocalizedRoute to hold the culture of that route ... ... But I think no need for that with RouteLocalization since there is a DefaulCulture value.
Anyway, does that post help in integrating RouteLocalization with MVC VNext?
Thank You, Miguel
Hi, I'm sorry for my late reply - there a lot of things going on in the moment (personal + business things) and I did not have time to go through MVC Next and RouteLocalization yet.
I still have it on my to-do list and can go through it hopefully in February.
I'm now diving deeper into MVC 6, as far as see now it should be possible to integrate almost all of the features of the current version.
As I have to start (almost) from scratch, I will also try to add http://www.appveyor.com/ for the MVC 6 version as suggested by @JobaDiniz a long time ago.
I'm still thinking how to restructure the project, for example moving the current master branch to MVC5 and making MVC6 the new master...
@Dresel What about naming it only RouteLocalization since MVC and API are now unified or maybe RouteLocalization.Core. Microsoft did a rename of the project as you can see here: http://www.hanselman.com/blog/ASPNET5IsDeadIntroducingASPNETCore10AndNETCore10.aspx
They didn't want the new technology to be seen as a sequence of ASP.Net 4 MVC 5 since is something quite new. To avoid future confusion I might not call it RouteLocalization.MVC6
Just an idea ...
Yeah that's the question. The VS2015 template I used includes the classic "Microsoft.AspNet.Mvc" nuget package, but there is another "Microsoft.AspNet.Mvc.Core" package out there. You know more about that?
If you look at MVC in Github (https://github.com/aspnet/Mvc) in Dev branch and even on RC1 there are two projects:
Microsoft.AspNetCore.Mvc.Core Where all Mvc code is ... In RC1 was Microsoft.AspNet.Mvc.Core https://github.com/aspnet/Mvc/tree/dev/src/Microsoft.AspNetCore.Mvc.Core
Microsoft.AspNetCore.Mvc Here there is only the class MvcServiceCollectionExtensions with a few extensions which are responsible for adding MVC to the pipeline on the Startup of an Asp.Net project. https://github.com/aspnet/Mvc/tree/dev/src/Microsoft.AspNetCore.Mvc
Not sure why they keep this class on this assembly ... Even on RC1 the structure is the same.
So maybe:
RouteLocalization.AspNetCore.Mvc?
Or if you want to distinguish between work for RC1 and RC2 onward:
RouteLocalization.AspNet.Mvc for RC1?
And
RouteLocalization.AspNetCore.Mvc for RC2?
What do you think?
I think I'll change the code namespace to RouteLocalization but I will add AspNetCore and possibly MVC6 to the nuget package description, to make finding it easier.
I have finished most of my tests with the latest (nightly RC3) version and I think that almost all features should be possible in AspNetCore. I will setup an aspnetcore branch soon and propose a possible implementation.
I have created a proof of concept branch for the vNext version. It's far from complete, but it shows the basic idea of translating routes with model conventions. The current workflow im using is the following:
ControllerModel
(only done for the first translation added, afterwards use the existing controller model)
RouteValue
and/or Properties
(guess I don't need both)Selector
s on the controller model and action modelsSelector
(copied from the "original" controller / action model) and set the Template
of AttributeRouteModel
to the specified translationIf you find some time feel free to go over it (you might have to add the nightly nuget package repository for asp.net vnext: https://www.myget.org/F/aspnetvnext/api/v3/index.json). If you have suggestions for the API usage I guess now is the perfect time.
Since we (have to) follow another approach in asp.net core we need special treatment for route names - to avoid duplicate route name errors each translated route with route name set will be renamed and gets the culture appended - something like "originalroutename:culture".
Hi @Dresel,
I just looked at your proof of concept and it looks promising. Is there anyway I can help you with to get this published into NuGet?
Thanks for your feedback.
Well any contribution is welcome. Since VS 2017 is now released and the tool chain for net core is now more or less settled I'm trying to release a preview version end of this month.
Defining requirements and test cases, testing, writing documentation or just giving feedback... do whatever you can / want.
FYI: Refactoring the proof of concept takes longer than expected but I'm almost done with an initial productive version.
Still a draft, but you can try
Install-Package RouteLocalization.AspNetCore -Pre
See the sample project of aspnet-core/dev branch for more infos.
I will finally close this now, don't hesitate opening new issues for feedback and similar.
Hello,
Is RouteLocalization already compatible with Asp.Net VNext?
Thank You, Miguel