-
Notifications
You must be signed in to change notification settings - Fork 728
-
Notifications
You must be signed in to change notification settings - Fork 728
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
Create .NET Standard Framework Build #1661
Comments
In order to build a .NET Standard version of the library, developers will need to have at least Visual Studio 2015 Update 3 installed if we put the projects in the main solution. In order to build from the command line, they will need For installing 1 - the cake script could check if it is installed and install it if it is not. It is a small download. I prefer option 1 so that every developer is always building For adding the projects to the solutions, as I said, it will require Visual Studio Update 3 or I think the latest versions of MonoDevelop, options are, 1 - Make running the latest versions of Visual Studio or Monodevelop a requirement for NUnit developers I prefer option 1 because it will ensure all of our code is compiled and checked, but I can understand this being an issue for some developers, please speak up. If we go with option 1, one thing I would like to explore is the new multi-targeting. For example, we could have only one copy of the NUnit Framework project that targets .NET 2.0, 3.5, 4.0, 4.5 and NetStandard. It would make our solution a lot smaller and more manageable. For an example of this, you can look at the https://github.com/nunit/dotnet-test-nunit project that targets The single project file also has the advantage in that it includes the NuGet packaging info so we could also drop our NuSpec files. As I see it, we have three decisions to make, 1 - Should we automatically install I plan to start working on this issue as soon as we do the repository split, so I thought we should get the discussion going. Let the jousting begin 😄 |
I should also add more about the reasons behind why we want to target If you still have questions or don't see the worth, please ask 😄 |
I have to do the "homework" before commenting in detail, but here are a few top-level ideas...
|
That in itself is more exciting than actually supporting NetStandard. ;-) Would love to see us make use of that. The only existing NUnit target NetStandard doesn't seem to support is CF, is that right?
I like option three. We talked about this when we put in the skip-Silverlight-if-not-installed bit. The Cake script could pause at the start and prompt the user if they want to install/skip the additional features for SL, CF and NetStandard. (If targeted) I imagine that would mean the majority of people would install, but installing anyway on the quiet doesn't seem right.
With VS Community 2015 being free, I think that would be reasonable. If a user couldn't upgrade for any reason, the solution would just not load the core projects anyway, right? If that's the case, making a separate solution doesn't seem necessary imo. I know nothing about MonoDevelop, and if that would cause any issues. :-) |
Can you spot the issue there? It means we can only test with .NET 4.5.1 and above using the current I've been meaning to add a feature suggestion to the |
@ChrisMaddock I think that VS Community 2015 solves the biggest piece of this for us. But somebody should figure out what's doable in the latest versions of MonoDevelop and (IMO) SharpDevelop before we take the leap. |
I did some homework:
Rob - would you accept help with this one? I can't offer any prior expertise, but sounds like fun. 😄 |
@ChrisMaddock help would be appreciated. There is already a branch up with work started on this. Look for the branch with this issue number. If you want, you can pull it down and bring it up to date and see if you can get it building again 😄 I won't be looking at it this week if you want to look at it. |
Didn't realise it was already under way - will have a look. Cheers! |
@rprouse Could we rename this issue to "Create .NET Standard Framework Build?" I'm sure you didn't intend to wipe out the portable build immediately anyway. 😄 Additionally, I hope you will release this as a series of incremental dev builds, without waiting for every missing feature to be added. |
@CharliePoole I have renamed it. Part of the reason why I wanted to move this to 3.6 is so that we could get the initial PR in early in the release and then add issues to re-enable individual features. We might want to create an epic for this, but we can do that once we get this initial PR done. |
FWIW the netstandard support that just landed MonoDevelop is for MSBuild based projects, not xproj. |
Thanks for the info @mhutch. I didn't know you can do netstandard projects using MSBuild based projects. Clearly I have more reading to do 😄 |
@rprouse yes, it's kind of hidden away :) In the project options for a PCL project there's an option to switch it to target netstandard. It's a little confusing because there's a project.json file in the MSBuild project - but in this case it's just a NuGet package manifest, essentially replacing packages.config. |
@mhutch thanks for that info. That would work better for NUnit. Do you know if the .NET Core tooling still needs to be installed for Visual Studio? Do you know someone that I can talk to for advice on which approach would be best for our project? |
@rprouse yes, this only works in VS2015 Update 3 with the .NET Core Tools RC. I'd personally recommend the MSBuild approach since MonoDevelop / Xamarin Studio supports it, but the official guidance is to use xproj: https://docs.microsoft.com/en-us/dotnet/articles/core/tutorials/target-dotnetcore-with-msbuild |
@mhutch thanks for the link. I think we fall into the "You may want to use MSBuild to target .NET Core for existing projects that already use MSBuild that you want to port to .NET Core" category 😄 |
I tried using the .csproj + project.json combination for a little while, but found myself in a world of pain. I've settled on a hybrid .csproj + packages.config / .xproj + project.json approach as a least worst option. The .csproj gives me a stable environment with quick compiles and the .xproj + project.json gives me multi-targeting and .NET Core support. It's not perfect, but it's maybe better than a proliferation of .cproj (one for each target) and a .xproj (for .NET Core support). Here is an example repo: @mhutch, I'm guessing MonoDevelop / Xamarin Studio would load the .csproj projects fine but would choke on the .xproj? (BTW, the two project types don't reference each other) |
Correct, MD/XS does not support xproj (and never will). |
@rprouse - Have you had any further thoughts on which way you think we should go with this? I've done the last couple of changes got things building again (excl SL & CF) - although ReflectionExtensions.cs will definitely need a tidy! 😓 There's still something a little odd going on with tests, will need to look at that. What are your thoughts on xproj vs csproj? I'm not following .NET core development that closely, but it sounds like .csproj is what we should be aiming for? Is it worth attempting to bite that bullet straight away, and keep everything in the one solution? |
@ChrisMaddock I am pretty sure I am going to go with the At this point, my rough plan of attack will be,
|
@rprouse - Looks sensible! Sounds like a bit of a one-man critical path until the last step, so I'll hold back until then. 😄 |
@ChrisMaddock once I create the branch and get things started, we could coordinate and work on the same branch. I could probably use help getting each project compiling, updating the build scripts, etc. I will contact you once I get started and we can coordinate. |
Maybe it's time to create a dev branch, making it the default branch in GitHub. That would make it easier to collaborate and to merge features that are partial and which we don't yet want released generally. I plan to do this for the NUnit 3 adapter once I release 3.5, so an option would be to wait and see how that goes - or you could just do it now if you like the idea. |
.NET Standard is intended to replace portable libraries and gives us access to more APIs which will allow us to re-introduce features that were dropped in the PCL version of NUnit like Timeouts, Platform detection, File and Directory asserts, etc.
I am marking this as design as the planning needs more work, but I hope to complete this for the next release, so I am moving to the 3.5 milestone.
We will need to decide if this replaces the portable version or if we deprecate PCL for one release. We also need to figure out which build tools support building .NET Standard libraries.
The text was updated successfully, but these errors were encountered: