-
Notifications
You must be signed in to change notification settings - Fork 481
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
Move to .NET Standard 2.0 #307
Move to .NET Standard 2.0 #307
Conversation
6dd0ed1
to
94cb867
Compare
94cb867
to
a5ba7e9
Compare
78f5b11
to
f151ae1
Compare
Can you add multitargeting for .NET Standard and Full .NET Framework (not only netstandard)? For example: Why? When target only netstandard2.0 it brings many dependencies which are included in full framework. |
This is resolved with >=net472 when referencing a netstandard2.0 library as it is the first version that doesn't need an additional support targeting pack to fully satisfy the netstandard2.0 surface area. |
.NET Framework on Windows 10 is updated with OS itself. For example I have
device (Tablet with sensor) which is used in hardware project. It Win10
version cannot be updated because it connected only with Modbus/Ethernet
devices.
This is why MS make multitarget in projects. Some library must exist in
most major .NET versions
чт, 26 Июл 2018, 19:08 Viktor Hofer <[email protected]>:
… Why? When target only netstandard2.0 it brings many dependencies which are
included in full framework.
This is resolved with >=net472 when referencing a netstandard2.0 library
as it is the first version that doesn't need an additional support
targeting pack to fully satisfy the netstandard2.0 surface area.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#307 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AIQ7OwPuGANpK_XuVzKxwtfO6dZXyrtsks5uKemYgaJpZM4VYDWr>
.
|
Wrong. The reason why we added multitargeting is convenience. Instead of having several different project files you now just have one and cross-compile.
That's what .NET Standard is for. I don't have a strong opinion. I can add the net470 tfm is you want so. But first I would like to see a response from one of the project maintainers to understand if and when they are willing to merge this PR. |
@ViktorHofer Thanks for your work on this PR. Lot of changes but I'm thinking a lot of them are definitely "for the better", since NetStandard-2.0 baseline removes a lot of unnecessary framework probing. Although I do have exactly one issue of trying to get the library to run on NetFramework-3.5 but it is just a single ask for the time being. @nemec and i are evaluating this and I was thinking of bumping to v3 to incorporate this change. Although I kinda wanted to remove some of the (weird-to-C#-people) F#-isms and introduce a fluent interface similar to Commander (https://www.npmjs.com/package/commander) for the v3 bump, we can probably reserve that for the v4 bump instead. |
I just tell about problem which I found.
I have device with Windows 10 (don't remember version but .NET Framework
4.6 work fine). It comes in IP65 and connected to other device with cable.
I cannot update Windows without losing warranty. So I cannot run 4.7 apps
on it.
I asked manufacturer about this - answer was "no problem, we make it even
co cost, but it takes 5 work days". I just recompile all sources on 4.6 and
forget about this problem, it takes less than 10 min.
This is a reason why I think that one of the target frameworks must be .NET
Framework which is shipped with Windows 10 RTM (I don't remember number). I
hate outdated technologies but for Windows 10 .NET Framework update process
can be complicated for embedded devices or devices which a used as embedded
пт, 27 Июл 2018, 22:35 Viktor Hofer <[email protected]>:
… This is why MS make multitarget in projects. Some library must exist in
most major .NET versions
Wrong. The reason why we added multitargeting is convenience. Instead of
having several different project files you now just have one and
cross-compile.
Some library must exist in most major .NET versions
That's what .NET Standard is for.
I don't have a strong opinion. I can add the net470 tfm is you want so.
But first I would like to see a response from one of the project
maintainers to understand if and when they are willing to merge this PR.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#307 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AIQ7OwRWMzVOzcErAhUFp2IasGsepFkAks5uK2uHgaJpZM4VYDWr>
.
|
@ericnewton76 great to hear. Please let me know what's necessary to get this merged. I really would like to get this into master asap as we internally depend on this library and right now using a forked release. EDIT:
Please ask yourself if you really want this. Servicing net35 is a HUGE burden and limits yourself in numerous ways. |
@ViktorHofer merged your PR into a specific branch: ViktorHofer-netstandard20, just a few questions: Just wondering whats the correct course of action on these two:
|
That are the disabled tests that assert on console outputs that vary. (described in top post). I disabled them with this commit: f151ae1 I suggest removing these tests completely or rewriting them. If you want I can also do that, as you wish. |
|
||
github gsscoder/CSharpx src/CSharpx/Maybe.cs | ||
github gsscoder/CSharpx src/CSharpx/EnumerableExtensions.cs | ||
github gsscoder/railwaysharp src/RailwaySharp/ErrorHandling.cs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure we can get rid of paket so easily, these files 3 files (Maybe.cs, EnumerableExtensions.cs, ErrorHandling.cs) get pulled in from their github project and compiled into the project. This was done to keep dependencies down and promote some code reuse.
And this is why paket works so much better than Nuget, because Nuget constantly made assumptions that were just not good in the real world.
Sigh. Not sure what to do here. I think the best approach is let nuget handle the nuget dependencies (which paket frankly usually handled better in most cases) and let paket handle the source code imports for the time being.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, I added these few files manually and removed Paket as with PackageReference and the new csproj sdk format it's unnecessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is no reason to use Paket here as the source code files probably won't change anymore (they didn't for multiple years). Also csharpx clearly states that the files can either be consumed via Paket or by manually copying them:
Source files are conceived to be manually added to other projects or by setting a reference via Paket. See these paket.dependencies and paket.references as example.
https://github.com/gsscoder/CSharpx#csharpx
I suggest to not make things more complicate as they need to be and just use nuget and get rid of Paket.
fyi, will finalize this later today. |
ok thanks. what about our Paket discussion? |
Any updates? |
This would be great to have, hitting NETStandard issues here |
This is a huge improvement and I would love to see this get merged in ASAP as well. Thanks! |
So, copying files is better than paket do that job. |
ping @ericnewton76 |
Sorry, ran into a hellacious work issue just before a little R&R. I'll try to push this out sometime this week. |
please generate nuget for .net standard 2.0 |
@ericnewton76 please please please merge |
I did git clone to the project and merged the branch 'ViktorHofer-netstandard20' on my machine. in vs2017.8 I tested the project for multi-target (net45 and netstandard2.0) and compilation/unit test pass successfully. The Conflicting files: The file: For example, the line#127
is modified by ViktorHofer to
So I suggest merging 'ViktorHofer-netstandard20' branch, resolving the confliction based on the above notes and select (theirs) of ViktorHofer modifications. The auto generated package v3.0.0:
|
Ugh. Really would love to have this. This is a blocking issue for anyone wanting to use this library from .net core. |
@moh-hassan oh man, thanks for doing that pull, I've been unable to find some time to devote to it lately. This really helps me out, knowing that somebody's been able to independently verify it (I have to get latest NetCore even installed yet) Will respond back here when I can pull a few hours for this. Should be able to this week! ::Fingers crossed:: |
@ericnewton76 |
bump |
@ericnewton76 Thanks for such a great library. Is there any ETA on when this will be merged? Currently blocked with netstandard issue |
Bump, any news? |
Please merge this and release a new NuGet package. 🍺 |
@ericnewton76 what's the status? I feel kind of neglected. |
At some point someone is just going to have to fork this repo and publish a new NuGet package. 😕 |
@ericnewton76 |
Any news? |
Sorry I've been extremely tied up. Been working multiple nights til at least 2am (last night 5am) trying to get a release out for work. |
Thank you very much @ericnewton76 for merging and Congratulations Netstandard2 for the community. |
Newest version supporting Net Standard 2.0 is now built and published. https://www.nuget.org/packages/CommandLineParser/2.4.3 https://github.com/commandlineparser/commandline/releases/tag/v2.4.3 |
Thanks, @ericnewton76. Don't burn out! |
@gitfool Thanks man, lol. I say, as I continue on at 12:30am, probably for another couple of hours... joys of working from home and somewhat overpromising complex software... unrelated to this of course, @ViktorHofer did most of the work. I don't think I'd have gotten to the whole conversion process in a reasonable amount of time... lol |
I also hope there will be multi-targeting for the nuget package - I think The point is, .NET fx 4.7.2 is not that popular especially in those old Win7 users. I'm not going to ask every user to install .NET fx 4.7.2 since it's not actually necessary for our functionality. when I set lower .NET fx versions for my project (net461), this lib adds so many System.*.dll to my release. I understand these dlls are just for redirection and are small in size, but it still looks redundant. |
Most of your customers/users should have net472 already installed as it's deployed over Windows Update. I don't see any reason to target a lower netfx version? |
Well, if a user is still using Win7, you can imagine he/she won't even turn on Windows Update to let MS notice him/her to update to Win10. Thanks for the reply, and I'm going to handle this problem (compile a net46 version) by myself. |
I wouldn't recommend that as you would be an easy target for tons of exploits. Being online without having the latest security patches (which includes .NET Framework) is like using the metro without having a ticket - risky. |
You're definitely right, but some users may just choose to install minimal security updates without any functionality updates like .net, or they uninstall that for some reasons IDK... Anyway, I don't think I can just rely on Windows Update to install netfx 4.7.2 for everyone. And, I would like to see more users using my programs, rather than switching to others just because I require them to install netfx 4.7.2 which has seldom things to do with the actual functionality. |
I see. Why not use .NET core instead with which you can deploy the framework together with your app? |
The same reason - it looks redundant with many files, and bigger. Thank you for listening to my complaints. Targeting to lower .net versions is a compromise and I should just do it by myself. As a developer, I would be happier if my program runs perfectly from WinXP to Win10, rather than "although .net 4.5 is enough for all functions in my program, you still need .net 4.7 if you don't want to mess up with a bunch of files". |
You probably want to wait for .NET Core 3.0 where you can link everything down to a single file.
I'm not the author 😁 |
Ah, I fogot what Author means in github issues. Plus there is also a Contributor label. Sorry for that. But I'm also glad that I can talk about these with a .net team member! |
Fixes #284
I'm from the .NET team and we are currently using this package in of our repos
xunit-performance
. As we are facing some package downgrades with the existing nuget package I upgraded it to target NS2.0.Changes:
commandline.dll
now targets netstandard2.0 and the xunit test librarycommandline.tests
now targets netcoreapp2.0 (not 2.1 as I wasn't sure if the CI already uses the 2.1 SDK)Requirements:
Please let me know if you have any questions.