-
Notifications
You must be signed in to change notification settings - Fork 6k
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
C# generated code should use ASP.NET core project structure #2886
Comments
@kbrooks thanks for the suggestion. Is there any official guide from MS on the ASP.NET core project structure? I did a search and found this: http://zablo.net/blog/post/modular-asp-net-core-project-structure (which is not official) Also to be clear, you're referring to C# API client but not ASP.NET5 server stub, right? Recently, there's a change to the folder structure via #2752 so please pull the latest master and give it a try if you've not done so. |
The official docs appear to be down right now, but in case they come back up: https://docs.asp.net/en/latest/conceptual-overview/understanding-aspnet5-apps.html. The main difference is the use of project.json files instead of the old xml configuration files. The ASP.NET5 server stub actually already uses the ASP.NET core project structure, so we could use that as a guide. |
Yup, I got a 404. Will check it out later. |
@kbrooks @wing328 I'd put this on the back burner for now. There's talk of dropping the See: https://twitter.com/davidfowl/status/730219570783363073 and https://youtu.be/P9HqMZviaMg?t=1712. There was also a pretty lengthy discussion on Reddit about a week ago. Since Xamarin Studio is free to use on OS X and Linux and Visual Studio Community Edition is also free to use, there's nothing blocking anyone from developing on mono on any OS. Both of these support targeting current .NET 4.6.1. The only thing this blocks is from consuming .NET Core assemblies, which I think would be fairly minor to incorporate after all the csproj stuff dies down. |
Looks like MS says they're going back to MSBuild https://blogs.msdn.microsoft.com/dotnet/2016/05/23/changes-to-project-json/ I've just downloaded my first swagger generated api server stub. I downloaded core RC1 to try to run it and it hosed my VS 2015 installation. Then I found this article, so I decided to make a new MVC5 project and incorporate the models/controllers and I'm having some trouble. Is there an example/tutorial out there somewhere? I've looked to no avail. Thx - Ken |
@kdc415 You should be able to run .NET Core RC1 and RC2/RTM side by side. I'm not sure why it would hose your environment. When I created the aspnet5 server generator, I created two examples here https://github.com/jimschubert/webapi-swagger-samples. The You should be able to develop against the generated code, and run in Docker if your local RC1 install is messed up.
The app should be available now on port 5000. To get the ip address of the
|
Thanks for the response and the advice - I'll give it a shot. This is a new project and I suppose I may as well bite the bullet and use the latest. I expect we'll see final release very soon. |
I know a lot of you are talking about this work being put on hold. For those that care I'm currently doing some work on this in stunney/swagger-codegen. I'll be making a PR soon :) |
@stunney I checked your master branch and the work being done there doesn't look relevant to this issue. The issue was to use the new project structure for ASP.NET Core for C# generators. As stated above, the aspnet5 generator is already set up this way. The client generators aren't candidates for this because they target .NET 3.5 and 4.0-4.5. The issue was updated a few comments later to clarify the request was to use the project.json build, which is deprecated. The reason I say your master branch doesn't seem relevant is it looks like you're trying to update aspnet5 to RC2. As stated in another issue, the final release is slated for June 27, so it doesn't make a lot of sense to update the current RC1 generator to RC2 now. Also aspnet5 should probably be updated to 1.0 RTM/Final in place rather than creating another generator. If you'd like to honcho that effort, let me know and I can comment in the other thread that you've got dibs. |
I can honcho that effort for sure :) I haven't checked it in yet, but I'm working on an msbuild moustache as well as the project.json file. Maybe I don't need both as per the discussions above. I can nix the json file :) |
@stunney You bring up good points ;) I've already accounted for the name change (via discussion only atm) in #3085. My suggestion for the name change was to have a top level generator called However, I don't think it would be beneficial from an open source community perspective to continue maintaining many separate Also, I have a few cleanup/include tasks in #2914 for the existing generator. If you're modeling your update after the current code, those are a few things that are missing. |
Looking to moustache-ize the .xproj file |
There's already support for project guid on the csharp generator. |
Blarg @jimschubert |
{{packageGuid}} Its so simple :) |
I don't know if I should reply here / start an issue. So basically |
@ogreenz I would suggest you to open a new issue for tracking and link to this one. |
We'll want this behind a flag (even if it's the new default behavior), because not all devs track on the latest Visual Studio. I was waiting until general availability before doing an update, because the .NET Core stuff is known to change on a dime. |
@jimschubert Well to be honest swagger kind of "forced" me to used the latest .NET Core stuff when it deprecated the |
Are you planning to change to .NET Core 2.0 in the next version? |
I personally would like to move to .net core 2 for Swagger Codegen 2.3. The issue with making the change before 2.3 is that it would be confusing if you've customized templates to have different (or missing) templates and configurations. |
@wing328 Should this be closed? |
+1 to closing this ancient issue. |
any prediction to launch client for asp.net core with dependency injection? |
We should add an option to the csharp generator to use the new ASP.NET core project structure.
@wing328
The text was updated successfully, but these errors were encountered: