3 ms·
It might be somewhat simple, but their paid Visual Studio IDE demonstrates no way to get there, and it probably should. The only project types tagged as service
by ocdtrekkie 6y ago
It might be somewhat simple, but their paid Visual Studio IDE demonstrates no way to get there, and it probably should. The only project types tagged as services are .NET Framework templates to make a Windows service.
I have to apparently read blog posts about how to get there myself with .NET Core. Suffice to say, Microsoft's move to the open source/Linux mindset may have come at the cost of being similarly confusing to get started with.
Note that your blogs happily tell me to add a single NuGet package for Windows or Linux, but doesn't bother to tell me how to assemble a project that will work on both.
- ripley12 6y agoSeems like you can just call both UseWindowsService() and UseSystemd(), they will no-op if called on the wrong platform. Personally I think I'd rather split Linux+Windows into thin OS-specific projects, but I haven't tried that. Agreed that a template or better documentation for this kind of multiplatform scenario would be nice.
- 737maxtw 6y ago> Note that your blogs happily tell me to add a single NuGet package for Windows or Linux, but doesn't bother to tell me how to assemble a project that will work on both. Well, the rest of the owl is fairly simple in this case. System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform() can be used to query the OS type, and you specify which builder option (i.e. if islinux UseSystemd ) to use there. I'd type a proper example but on a cell phone. All of that said, YES you think they would document this better.
- ocdtrekkie 6y agoI mean, fundamentally it shouldn't even be "documented". They should have a template that just does it. I should select the Service (.NET Core) template, it should give me the start, restart, stop, etc. points to start adding code, and I should be able to select Windows or Linux as build options by default. Anything that requires I go read a blog post is a massive regression from legacy .NET Framework templates, where I never had to know how a service is built. Visual Studio has traditionally done most of the heavy lifting on managing scaffolding, but in the past couple releases I've found things are often broken unless I go manually edit some file that I previously never had to edit which can't even be edited from within the IDE.
- 737maxtw 6y agoI'll agree with you there. I'm not a fan of the scaffolding and the overall obtuseness around applicationbuilder, before I understood it the thing felt more unintelligible than a monad burrito to a first year cs student.
- benaadams 6y agoVisual Studio 16.8 Preview 2 Tools…Options -> Environment -> Preview Features -> “Show all .NET Core templates in the New Project dialog” https://devblogs.microsoft.com/dotnet/net-cli-templates-in-visual-studio/ https://devblogs.microsoft.com/dotnet/net-cli-templates-in-v...