3 ms·
.NET Core really needs to figure out how to become somewhat accessible. I (.NET <= 4.6 developer as my day job) recently tried to setup a new project after it h
by dvcc 10y ago
.NET Core really needs to figure out how to become somewhat accessible. I (.NET <= 4.6 developer as my day job) recently tried to setup a new project after it hit 1.0 and I was extremely disappointed.
The first step was to create a new project, okay cool. `dotnet new MyProject` -- oh wait I want it to be a class library. Let's see `dotnet --help`, hmm I don't see an option (at least not when I tried). Oh `dotnet new MyProject -t lib`, of course!
Okay lets add xUnit and xUnit-runner. There is no simple command line utilty that I saw to add them, so I have to manually edit the project.json file (wait isn't this supposed to be csproj again?). Oh wait there are weird compatibility issues between all the .NET Core versions, I have to manually go look it up on the xUnit page (https://xunit.github.io/docs/getting-started-dotnet-core.html https://xunit.github.io/docs/getting-started-dotnet-core.htm...). Okay I have the correct version listed, let's run my first test.
Error... Oh the created class library is targeting netstandard15, which I thought was all I needed? I need to add netcore50. Some other unexplained error occurred and I gave up for the time being. Yea maybe I could have sat through it an persevered, but why should I? Why should it all be so complicated and require two different frameworks just to get a small class library and a test project going.
Was I using it wrong? Most likely, but oh well. It was frustrating enough for me to just not continue with it. .NET Core fatigue feels more real than JavaScript fatigue.
- jongalloway2 10y agoI'd recommend using the tutorials rather than just typing stuff and seeing what happens. The language and concepts are the same, but there are some big differences at the framework and platform level. The xUnit tutorial is here: https://www.microsoft.com/net/tutorials/csharp/getting-started/testing https://www.microsoft.com/net/tutorials/csharp/getting-start... Those tutorials are pretty intro level, but they do cover some of the issues you ran into. Also, I'd recommend checking out the new Visual Studio 2017 RC with updated .NET Core tools and support for the csproj based projects: https://blogs.msdn.microsoft.com/dotnet/2016/12/12/updating-visual-studio-2017-rc-net-core-tooling-improvements/ https://blogs.msdn.microsoft.com/dotnet/2016/12/12/updating-...
- dvcc 10y agoI just took a brief look at the tutorial and it would still get me caught up on the same issues. The class library created by `dotnet new -t lib` had a different target framework than most tutorials, and short of just copying and pasting in a whole new project.json file (which changes the target framework and imports two more) I am out of luck. It's pretty confusing and tiring!
- jongalloway2 10y agoIn Visual Studio 2017 RC it's "File / New / xUnit Test Project" and you're all set. I think some of the docs and presentations have gone a little far to the everything-commandline direction. If you're an experienced .NET dev, you're probably going to be a lot more comfortable with Visual Studio at least to get started. Much easier to start with some working code and break it / play with it than to start at the command line and a project file... again, if you're an experienced .NET dev who's used to Visual Studio. I will agree with your main point that it is confusing and that it should be easier. Those are actually some of the top things listed on the roadmap.
- dvcc 10y agoAdmittedly, I would be much better off using VS to create the project/install packages/etc but I thought I no longer needed to, hell they were providing yeoman generators for .NET Core (but they weren't always updated at the same time as a new release)!
- nightski 10y agoIf you need a GUI to guide you through each step and can't take an hour or two to learn the platform you are using every single day then you should probably just wait until VS2017 comes out.
- dvcc 10y agoThe CLI is new to .NET Core, and .NET Framework/.NET Core are practically different platforms. Despite that, I don't get why I should struggle that much trying to get a simple empty project going.
- justabystander 10y agoI don't know if you've noticed this or not, but, while the .NET Core has hit RTM, the tooling is always marked as being a "Preview" for good reason. (https://www.microsoft.com/net/core https://www.microsoft.com/net/core) They've got a solid idea on how to work .NET Core, the desktop .NET framework and .NET Standard as the bridge, but the tooling for .NET Core work is undergoing frequent revisions.
- nightski 10y agoIt's really not that complicated. You described pretty much all the trouble in less than a paragraph. It sounded like 10 minutes of fiddling around. For creating a cross platform library that just works it's pretty painless. Have you tried java/maven? Or webpack? Or god forbid cross platform C++? Your problem seems to be focused on the fact that command line interfaces are not discoverable. This is true of all command line interfaces. Linux/Unix has many utilities that are quite foreign at first. But once you learn the interface (and in this case it is quite simple) you can accomplish things with quite a bit of efficiency.
- dvcc 10y agoI don't know, I don't think my main problem was with the CLI rather how hard it was to just get something small going. In contrast, node takes all of 5 seconds to setup a small library, install dependencies, clearly list required engine, etc. Is it perfect, no way; however, it isn't very complicated either. I don't think I'm totally alone with that sentiment either. .NET Core was a project that had pretty high expectations from the beginning, a cross-platform, sane and simpler .NET development platform (C#/F# too!).
- divbit 10y agoMaybe this little script of mine could help you (dni=dot net init helper) https://github.com/divbit/dni https://github.com/divbit/dni It does dot net init and a pre set up library.