Conversation
|
Sorry I made this pull complicated by merging a recent commit. Do you think it would be better to support .NET Core 2.2? I do not know much about .NET Core, but I am having some difficulty getting this to compile on my system. I look forward to hearing your suggestion! |
|
Gui app available only for .NET Core 3.0, and it is still in preview. Good improvement for you library. I also do not know much about .NET Core. |
|
You need to install dotnet core 3.0 SDK to be able to build it. |
|
I'm concerned about this switch. It looks like .NET Core 3.0 is still in preview and only supports certain preview versions of Visual Studio preview. I did a couple installs and reboots and still must not have the right version of things installed. My concern is that making this hard to compile will limit who is able to use and contribute to the project. Maybe we can note in the readme that this code is configured as a .NET 4.5 project but is compatible with .NET Core (tested on 2.2 and 3.0). I'll continue to search/read about publishing projects for multiple frameworks. |
|
In Visual Studio 2019 you have to: Tools > Options > Environment > Preview Features > Use preview of the .NET Core SDK ... I'm still favoring documenting that ScottPlot is comparable with .NET Core 3.0, rather than switching the project to it and requiring users to figure this out. |
|
It looks like oxyplot (a similar charting library) keeps separate folders, one for every platform they target: https://github.com/oxyplot/oxyplot/tree/develop/Source If we supported multiple frameworks I think it means we would have to maintain multiple .csproj projects (and a separate NuGet packages). This seems like a good goal for the future when ScottPlot matures and settles down. For now ScottPlot is being actively developed and evolving rapidly so at this time I'll probably keep it .NET 4.5 (which was already toned down far from 4.8 (#15)). Thank you @petarpetrovt for bringing my attention to the fact that this project compiles in .NET Core without modification! |
This reverts commit 346ab88.
thanks @petarpetrovt for noticing that this code compiles in .NET Core 3.0 without requiring modification
|
@petarpetrovt maybe you can make standalone script that compiles current .NET Framework project with .NET Core 3.0 and add this script to project. .NET Core have a good command line support as i know. That will be a good for everyone solution. |
|
I'll give it a try! edit: people have programs to help with this:
Also, the .NET Portability Analyzer may be useful here: |
|
We could define compilation variable |
|
Other solution make separate branch for this PR. But someone will need to synchronize it periodically. |
|
Good article about this problem |
|
This branch now has two new files ( What do you think about this "solution"? |
had to do this for the case-sensitive folder name
Removed most of the demos. Kept the minimal projects which are very unlikely to change.
|
ScottPlot-dotNetCore.sln loaded with error and targeted .NET Framework 4.5. |
we can build (with NuGet) without needing this solution
Adding an extra .csproj for .NET Core users may work, but it feels like a hack. I'll modify the folder structure of this project to support multiple frameworks and use the oxyplot library as a reference for how to do this. edit: I'll do this after core 3.0 is officially released and supported by standard versions of Visual Studio |
|
Microsoft thinked a lot about how to make people migrate to .NET Core with no cost. I am also surprised that it turned out to be so simple. To be completely sure that it works, need .NET Core 3.0 gui demo app, that uses compiled library. |
This reverts commit 43e9c6a.
|
Okay I finally decided what I want to do. The simplest way to support multiple frameworks this from a developer's standpoint is to replace existing NET45 projects with .NET Core ones (described here). That's what @petarpetrovt's initial pull request did. The reason that solution is not good now is because .NET Core 3.0 projects are difficult to compile at this point in time. .NET Core 3.0 is prerelease, and you have to go through menus to even enable it in Visual Studio. A difficult to compile open source project is bad because it discourages community involvement. However, when .NET Core 3.0 is officially released (in about a month) and is supported by regular versions of Visual Studio, then I'll migrate all the .csproj files in this project to .NET Core. At that time I will make NuGet build scripts for separate ScottPlot.Core and ScottPlot.Net45 NuGet packages. For now, the ScottPlot-dotNetCore.csproj file can live in the main source folder. |
I think thats enouth. You dont really need to remake all demos, just add 1-2 that demonstrates .NET Core usage. Main target of this PR as i think is to get ScottPlot.Core on nuget. |
|
Note that a .csproj like this allows .cs files to be sucked in from file paths: <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<Version>3.1.0</Version>
<PackageId>ScottPlot</PackageId>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<RootNamespace>ScottPlot</RootNamespace>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\ScottPlot\*.cs" />
<Compile Include="..\ScottPlot\**\*.cs" />
</ItemGroup>
</Project>
|
|
Following-up, https://www.nuget.org/packages/ScottPlot.WinForms/ now supports .NET Core 3.0 and .NET Framework 4.6.1 |
Add support for .NET Core

Migrate to dotnet core .csprojs and target both .Net45 and netcoreapp3.0