Skip to content
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

Add support for AspNet Core MVC 1 #65

Open
kevinkuszyk opened this issue Feb 5, 2016 · 17 comments
Open

Add support for AspNet Core MVC 1 #65

kevinkuszyk opened this issue Feb 5, 2016 · 17 comments

Comments

@kevinkuszyk
Copy link
Member

I think the T4MVC T4 template will work with AspNet Core MVC 1, but T4MVCExtensions doesn't compile against coreclr.

We also need #64 before we can ship this.

@kevinkuszyk
Copy link
Member Author

@davidebbo thoughts on a V4 milestone for this and #64?

@davidebbo
Copy link
Contributor

Whether it should be v3 depends on whether it entails is a breaking change to .NET 4.x users (based on semver semantics). But hopefully it doesn't, and is separate work that makes Core work without breaking existing.

Do you think it can be the exact same template or will it be a different one?

@kevinkuszyk
Copy link
Member Author

Hopefully we can use one xproj / project.json project to build T4MVCExtensions for both net40 and dnxcore50 (or whatever the TFM will be called when RC2 drops). I didn't get any time to look too much into this yet.

Do you think it can be the exact same template or will it be a different one?

Hopefully the same one will work (famous last words!). Unfortunately I can't test in in VS as it just hangs at the moment. I'll try again when the next tooling update is out. Do you get internal VS builds you can try it on?

If the template needs some changes to make it work, maybe that effort would be better spent on R4MVC?

@davidebbo
Copy link
Contributor

Yes, I saw that hang too when I tried, but I don't know what the deal is. Would be best to open an issue in core with hopefully a simple repro that those guys can look at (I run regular VS).

We can evaluate whether to go with R4MVC based on how drastically different things become in Core.

@kevinkuszyk
Copy link
Member Author

I asked @sayedihashimi to re-open aspnet/Home#272 earlier. Hopefully that's enough to get it on the tooling team's radar.

There's also a sample repro here: https://github.com/kevinkuszyk/aspnet-core-t4mvc.

We can evaluate whether to go with R4MVC based on how drastically different things become in Core.

Yes, let's make that call once we know how broken it is.

@davidebbo
Copy link
Contributor

At the time, I had debugged the template a bit and found that the hang happened in the T4MVC multi-file support. But beyond that I couldn't pinpoint the cause.

@sayedihashimi
Copy link

See aspnet/Tooling#394

@kevinkuszyk
Copy link
Member Author

@davidebbo, based on @mlorbetske suggested fixes in aspnet/Tooling#399, I think there are 3 things we need to do if we want to support MVC Core:

  1. Make @mlorbetske's changes to the template so that it can run in both .csproj and .xproj projects.
  2. Generate the correct namespaces if we are in an MVC Core project.
  3. Nest the .generated.cs files under the T4MVC.tt file in .xproj projects.
    image

I have the T4 template generating in a branch in my sample repro, but it doesn't build because all the namespaces have changed.

How much effort do you think is involved to make these changes, and do you think I missed anything?

Unfortunately I don't have much time to dedicate to this at the moment (or much knowledge of T4). Maybe someone in the community can pick this up?

@davidebbo
Copy link
Contributor

@kevinkuszyk I also have very limited time to help. But if someone drives a change which doesn't look too scary and makes Core work without breaking current scenarios, I'm all for it.

@valeriob
Copy link

Hi all, how is t4mvc moving ? What's the status on this based on the recent alpha of msbuild tooling ?

@kevinkuszyk
Copy link
Member Author

@valeriob I've not looked at this for a while or had a chance to look at the new MSBuild tooling yet.

If you have the time we'd love to take a PR with this.

We also started a sister project to bring similar features to MVC Core, but that project is also stalled at the moment.

@valeriob
Copy link

Hi @kevinkuszyk sorry but i do not understand is T4MVC or R4MVC going to work with asp.net core ?
I mean i can't believe that people are actually using asp.net core without strongly typed urls, it's just insane :D

@kevinkuszyk
Copy link
Member Author

The ambition is for one or both to support MVC Core. There are some challenges to get there though:

  1. MVC Core is a new framework. Making a single TT template which supports both is going to be difficult.
  2. R4MVC will only support MVC Core, but as it's new we have to start from scratch.

If you have some time to pitch in, maybe you can make it happen!

@valeriob
Copy link

Yea i'd love to have time for this, and all other projects that we need that are left behind in the transition to core :D

@valeriob
Copy link

valeriob commented Dec 14, 2016

I'm sorry but there are too many things to learn to help with this (project system, nuget, dotNetCore quirks), i'm willing to test the early version but i really think that something that important should be started by who deeply know what we are talking about. I think there is a very big big gap in aspNetCore Mvc right now, i can't understand how are ppl willing to write a web applications with magic strings for creating urls, a real nightmare.

@artiomchi
Copy link
Member

For the people interested in this, I'm making great progress on this in T4MVC/R4MVC.

An early alpha build is basically imminent

@davidebbo
Copy link
Contributor

@artiomchi awesome, thanks for helping make it happen! Sorry, that I'm not able to get involved in that project, but I fully support the effort in spirit :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants