generator-csharp
generator-csharp copied to clipboard
What's missing?
We recently got started on this project and for the initial release we are thinking to have the following content below.
Generators (project templates)
- Class library
- Portable class library
- Console app
- xUnit test project
Sub-generators (item templates)
- New Class
- New Interface
- app.config
- AssemblyInfo.cs
- Resource file
- xUnit test case
I'd like to find out what you think is missing here and how we can make this better.
Is it possible to detect or be able to specify the version of the .net framework being targeted and if it's .net 5 then use the new project structure? Or should a new generator be created for .net 5 projects?
@ciwchris thanks for the reply.
VS telemetry tells us that most people pick the latest framework to target. Also it's easy to modify the target Fx after creating the project. You just edit the <TargetFramework>
element in the .csproj file.
That being said we could consider a --fx
switch which could set this. This is similar to the --gulp
option available in the asp.net 5 yo generators.
Thoughts?
I'm liking @sayedihashimi 's idea about having a --fx-
flag.
I created #14. I'm supportive of it.
I was hoping to not use .csproj files and instead have projects created similar to the sample console app when using .net5. Could the default be no .csproj files but if an older version is specified using the --fx
flag then .csproj files would be used?
Unless I'm misunderstanding something the new JSON based project files are only for ASP.NET, or are they for all .NET vNext?
@ciwchris I like that idea :smile:
@SamuelEnglard The new JSON based project files can be used to build any project type (build not run). It's a project system that supports cross compilation and producing nuget packages out of the box.
So is JSON replacing *proj files? If so then clearly when targeting latest we should use it. If not we might need another flag, though I'd make the default JSON still for newest
I was hoping to not use .csproj files and instead have projects created similar to the sample console app when using .net5.
As Fowler mentioned you would use generator-aspnet
in that case. I just posted a wiki on the goals of generator-aspnet
and how we are recommending for others to create related generators https://github.com/OmniSharp/generator-aspnet/wiki/goals-and-related-generators.
So is JSON replacing *proj files?
No (or at least not yet). If they do then we will adapt this generator as well as generator-aspnet to align with whatever Visual Studio ships.
Thank you for the clarification, I did not realize there was a new console application under aspnet, that was unexpected.
We're in the process of refining it.