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

Use netstandard instead of netcoreapp #16

Closed
garyng opened this issue Jan 10, 2020 · 4 comments
Closed

Use netstandard instead of netcoreapp #16

garyng opened this issue Jan 10, 2020 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@garyng
Copy link

garyng commented Jan 10, 2020

Since this is a library, using netstandard (I did it in my fork garyng@cbd0dec) instead of netcoreapp make much more sense, doesn't it?

This way you can avoid having multiple projects to support multiple version of .net core.

@shinji-san shinji-san added this to To do in Distribution with NuGet via automation Jan 10, 2020
@shinji-san shinji-san added the enhancement New feature or request label Jan 10, 2020
@shinji-san
Copy link
Owner

Hi @garyng

thank your for your feedback. This project covers the requests of different partners. These developers want to use this project in their solutions directly. Some of these build environments are restricted or have restrictions e.g. if someone uses .NET FX v4.5.2 , this person will have problems with a library which is built against a .NET Standard 2.0 (see garyng@cbd0dec). So I have to keep an eye on the C# language features, .NET APIs etc.

So I will try to provide solutions for .NET Core LTS versions. I orientate myself to .NET implementation support, .NET Standard versions and .NET Core release lifecycles
But, and I hope that satisfies your request, I will implement a solution for NuGet in the next weeks. And for that case it makes absolute sense to build against .NET standard 2.0 among other things.

Could I help you? Do not hesitate to contact me with any questions.

@garyng
Copy link
Author

garyng commented Jan 11, 2020

Thanks for the explanation! I didn’t think of that much!

From what I know, supporting netstandard2.0 would give you support for netcoreapp2.0 and above (since all of them implementnetstandard2.0) right? This would probably cut down the number of project files that need to be maintained. However, the netfx project still need to be there though.

@shinji-san
Copy link
Owner

shinji-san commented Jan 11, 2020

You're welcome!

Short summary:

  • .NET Standard specifies a set of APIs
  • .NET Core describes a platform.

As long as this library is linked to your final .NET application (which must specify a platform), you are right. That's the reference assembly case (or classical NuGet case).
But there are corner use cases. In these cases this library must be an "runtime" assembly, otherwise you will get a System.BadImageFormatException ("..Reference assemblies should not be loaded for execution..") by the Assembly.LoadFrom function.
Imagine that the developer has to use/load this library at runtime, so the developer has the possibility with these extra project files.

@garyng
Copy link
Author

garyng commented Jan 11, 2020

Ohhh, understood. I’m still young and too naive.

Thanks a lot! I guess this can be closed.

@garyng garyng closed this as completed Jan 11, 2020
Distribution with NuGet automation moved this from To do to Done Jan 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Development

No branches or pull requests

2 participants