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

Add support for .NET Core #300

Closed
46 of 47 tasks
daveaglick opened this issue May 23, 2016 · 89 comments
Closed
46 of 47 tasks

Add support for .NET Core #300

daveaglick opened this issue May 23, 2016 · 89 comments
Labels
General Enhancement New feature or request

Comments

@daveaglick
Copy link
Member

daveaglick commented May 23, 2016

Converted to netstandard2.0/netcoreapp2.0:

Clients

  • Cake.Wyam

2.x client strategy is discussed in #668

Core

  • Wyam.Common
  • Wyam.Configuration (need to look closely at custom assembly resolution)
  • Wyam.Core
  • Wyam.Hosting (need to investigate LiveReload support in .NET Standard)
  • Wyam.Testing
  • Wyam.Testing.JavaScript

Extensions

  • Wyam.AmazonWebServices
  • Wyam.CodeAnalysis
  • Wyam.Feeds
  • Wyam.GitHub
  • Wyam.Highlight
  • Wyam.Html
  • Wyam.Images
  • Wyam.Json
  • Wyam.Less
  • Wyam.Markdown
  • Wyam.Minification
  • Wyam.Razor
  • Wyam.Sass
  • Wyam.SearchIndex
  • Wyam.Tables
  • Wyam.Xmp
  • Wyam.Yaml
  • Wyam.YouTube

Recipes

  • Wyam.Blog
  • Wyam.BookSite
  • Wyam.Docs
  • Wyam.Web

Client Tests

  • Cake.Wyam.Tests

Core Tests

  • Wyam.Common.Tests
  • Wyam.Configuration.Tests
  • Wyam.Core.Tests
  • Wyam.Hosting.Tests

Extension Tests

  • Wyam.CodeAnalysis.Tests
  • Wyam.Highlight.Tests
  • Wyam.Html.Tests
  • Wyam.Json.Tests
  • Wyam.Markdown.Tests
  • Wyam.Minification.Tests
  • Wyam.Razor.Tests
  • Wyam.Sass.Tests
  • Wyam.Tables.Tests
  • Wyam.Xmp.Tests
  • Wyam.Yaml.Tests
  • Wyam.YouTube.Tests

Integration Tests

  • Wyam.Examples.Tests
@gijswijs
Copy link

Just to be helpful: OctopusDeploy release a tool to help with migrating to Core:

https://icanhasdot.net/result?github=Wyamio~2FWyam

@daveaglick
Copy link
Member Author

@gijswijs Thanks, I'll check that out! I'm hoping to start this effort fairly soon. It looks like many of the libraries we depend on have either ported or are in the process.

@airtonix
Copy link

airtonix commented Sep 3, 2016

Yep, i'd love to use this inside docker/linux

@Vladekk
Copy link
Contributor

Vladekk commented Dec 28, 2016

Any progress on this yet?
Docker is on the rise, so Core support would be awesome.

@pauldotknopf
Copy link
Contributor

I'd be willing to help out to add .NET Core support.

@williamwgant
Copy link

Is there a list floating around somewhere of what has to be fixed for Wyam to run on core? Is it possible to generate one somehow?

@pauldotknopf
Copy link
Contributor

@daveaglick Can I get started on this now? I need to make wyam as a part of the build process, and I want to use a docker image for the build server :)

@pauldotknopf
Copy link
Contributor

I'd probably get the core/tests done first. Then, module-by-module, we will inspect dependencies and determine if we can support .NET Core. I remember seeing a few dependencies that didn't have .NET Core support.

@daveaglick
Copy link
Member Author

@pauldotknopf Be my guest! I haven't dug too deeply into it because I suspect some of the assembly context and application domain loading stuff may be a pain until those are introduced in netstandard 2.0. That said, if you're able to get around it, I'd be happy to make some progress here.

@daveaglick
Copy link
Member Author

daveaglick commented Jan 27, 2017

@pauldotknopf Good call - most of the challenging stuff is going to be in Wyam.Configuration. If you can get some of the other libraries moved over to netstandard 1.5 now that'll reduce the lead time in any case. And it shouldn't be too disruptive since I just updated everything to Framework 4.6.2 which can consume netstandard 1.5 libraries.

@philippgille
Copy link

@pauldotknopf @daveaglick Hi, is there any progress regarding Wyam on .NET Core? I didn't try it out, but the docs still say that Wyam runs on .NET Framework 4.6.2

@daveaglick
Copy link
Member Author

@philippgille That's correct, it's still full-framework only. Work is progressing on .NET support but it'll still be another couple months.

We need to convert all the extension libraries to netstandard first, then can convert the core Wyam libraries. netstandard 2.0 is a blocker for some of the core libraries given the way assemblies are dynamically loaded.

Rest assured that .NET Core support is definitely high on the priority list.

@philippgille
Copy link

The blocking feature is probably System.AppDomain? This document mentions that AssemblyLoadContext is recommended now, although it doesn't say if it's recommended over AppDomain in general or only until netstandard 2.0 supports it.

Quote:

AppDomains can be used for different purposes on the .NET Framework. For code isolation, we recommend separate processes and/or containers as an alternative. For dynamic loading of assemblies, we recommend the new AssemblyLoadContext class.

I didn't work with any of the two namespaces yet, so I don't know if it's a viable alternative for Wyam (or its dependencies).

@MaximRouiller
Copy link
Contributor

@daveaglick so.............. ? You waiting for the next major release buddy? 😉 😛

/poking

@daveaglick
Copy link
Member Author

@MaximRouiller Waiting on an enterprising developer to drop a full porting PR in my lap. Hasn't happened yet, but doesn't mean it won't 😉 😉

@MaximRouiller
Copy link
Contributor

LOLLL

So... apparently, I'm going to be taking vacations soon. How long do you think this is going to take?

@MaximRouiller
Copy link
Contributor

Or rather, what are the "steps" that are necessary to do and how many can I do in a weekend?

@daveaglick
Copy link
Member Author

To be honest, I'm waiting on netstandard 2.0 to drop. There's a lot going on under the hood with regard to assemblies, dynamic compilation, and binding and 2.0 should have the reflection parts to make that much easier to port. Don't want to spend a ton of time on workarounds now if it'll mostly work with minimal changes soon.

@MaximRouiller
Copy link
Contributor

So... it's officially "waiting on 2.0" status.

@daveaglick
Copy link
Member Author

Yeah. I just don't have the time to go chasing the bleeding edge.

@MaximRouiller
Copy link
Contributor

Yeah, no point in stabbing ourselves in the face with that edge. 😛

@williamwgant
Copy link

According to this:

https://github.com/dotnet/core/blob/master/roadmap.md

They drop a preview in Q2, with the thing going live in Q3. Assuming less code churn in v2 than in the initial alpha/beta/rc run for core, that means we could be hitting this fairly soon.

@pauldotknopf
Copy link
Contributor

Ya, I don't see any reason why this can't be started now.

I have been watching the changes in corefx/coreclr. The work has been really adding back old api's that don't exist for coreclr yet.

@pauldotknopf
Copy link
Contributor

Many 3rd party libraries are now supporting .NET Core. The water feels good. Come in.

@williamwgant
Copy link

What would be the process to do that with this codebase? I've coded in core, but haven't ported anything to it. Do we just pull down the solution and start switching project properties to use netstandard? My impression was that project structures changed significantly going to core and that Microsoft (probably) didn't provide any kind of migration tool. Has that changed?

@Silvenga
Copy link
Contributor

@daveaglick I pulled down Fleck and ran the portability analyzer. It appears that Fleck has full API compatibility for .NetStandard 2.0 and .NetCore 2.0. 🎉 I'm so happy for 2.0.

image

https://docs.microsoft.com/en-us/dotnet/standard/analyzers/portability-analyzer

@Silvenga
Copy link
Contributor

@daveaglick created a pull request over on Fleck's side to support .NetStandard - statianzo/Fleck#220.

@daveaglick
Copy link
Member Author

@Silvenga Nice! And looks like they’re game to take it in quickly too.

Based on your portability analyzer run, I also did some experiments with switching Wyam.Hosting to netstandard as-is. It looked promising, so may be able to switch even before a Fleck update is published. Just needs a little more testing.

@escobar5
Copy link

escobar5 commented May 3, 2018

Should Wyam.Razor work on a .NET Core 2.0 app? I get this error when I try to use it:

TypeLoadException: Could not load type 'Microsoft.AspNetCore.Razor.RazorEngineHost' from assembly 'Microsoft.AspNetCore.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.

As far as I see, RazorEngineHost is not part of Microsoft.AspNetCore.Razor on .Net Core 2:

Microsoft Docs

@RLittlesII
Copy link
Contributor

I am attempting to upgrade Wyam.Hosting. It appears that there is no netstandard target for the owin.dll. Has anyone experienced this or am I just missing something. The following packages won't resolve on a netstandard2.0 target.

  • Microsoft.Owin
  • Microsoft.Owin.FileSystem
  • Microsoft.Owin.StaticFiles
  • Owin.Websockets.Fleck

I pointed all of the above to the latest package and it is still telling me that they depend on owin 1.0. Can anyone else confirm, or point me at an issue? I found this issue that discusses the problem. But I could be off.

@pauldotknopf
Copy link
Contributor

Owin is old technology that won't be updated.

Consider it deprecated.

@RLittlesII
Copy link
Contributor

@pauldotknopf Then what replaces Owin so I can get Wyam.Hosting ported?

@daveaglick
Copy link
Member Author

I’m hopefully circling back around on the porting effort starting next week (I’ve got a Big Thing launching that’s been taking much of my attention recently).

In the meantime, can probably look at https://github.com/natemcmaster/dotnet-serve for an example of how to do this sort of thing under .NET Standard. It basically does exactly what Wyam.Hosting does, just as a global tool. I even ported some of the Wyam.Hosting functionality over to that project, so now we need to port it back to Wyam.Hosting.

The bigger challenge is going to be the Live Reload bits. I think those are .NET Standard so might work out of the box under .NET Core, but we’ll need to be careful there. May end up swapping for SignalR at some point for that.

@daveaglick
Copy link
Member Author

@escobar5 Wyam.Razor is a bit of a mess right now. It uses the ASP.NET Core 1.x Razor stuff and the Razor API is totally different in ASP.NET Core 2.x. Not to mention there are a lot of tricky assembly conflicts and breaking changes between the Razor bits currently in Wyam.Razor and the more recent .NET Standard 2.x bits other Wyam module libraries are using.

Presumably the new ASP.NET Core 2.x Razor APIs are simplified but I haven’t had a chance to look closely yet. As part of the port to .NET Standard/Core I want to rewrite the entire Wyam.Razor module to use the new bits before releasing Wyam 2.0 and saying Wyam is .NET Core ready. Right now Wyam is only tested on .NET Framework (though we’re inching closer to .NET Core support).

@RLittlesII
Copy link
Contributor

@daveaglick Is your port public? I'm going to continue hacking at this, and try and help you out a bit.

@daveaglick
Copy link
Member Author

Awesome! 👍 yeah, everything in dotnet-serve is oss and my PRs have been merged

@Daniel15
Copy link

Then what replaces Owin

@RLittlesII as far as I know, ASP.NET Core is supposed to replace OWIN. You can self host using Kestrel, and ASP.NET Core's middleware API is roughly based off OWIN's

@MisinformedDNA
Copy link
Contributor

So what's the deal with using Tabular?

Wyam.Tables (blocked by Tabular libraries)

The last version came out 7 months ago and before that the last version was in Oct 2014. This project seems mostly dead and, as far as I can tell, is not hosted on GitHub, or anywhere public, and does not have a specified license associated with it.

Proposal: Switch to EPPlus and CsvHelper.

I have used these for multiple projects and have been very happy with them. Also, Tabular.Excel actually depends on EPPlus, so even they like it.

CsvHelper and EPPlus both are

  • open-source licensed
  • available on GitHub
  • target .NET Standard 2.0

@daveaglick If you agree, I would like to replace Tabular with EPPlus and CsvHelper.

@daveaglick
Copy link
Member Author

@MisinformedDNA That would be awesome - haven't looked too closely at that one yet, so if swapping out Tabular for one of the other libraries is doable, a PR would be great.

@MisinformedDNA
Copy link
Contributor

Cool. I'm on it.

@MisinformedDNA
Copy link
Contributor

Took a look at Rant and he has no plans to support .NET Standard. As far as I'm concerned, that's equivalent to saying that the project is dead.

So we either we do the port for him or fork it or we deprecate the TextGeneration module. I took a look at it and the tests and I have absolutely no idea what this thing is supposed to be used for. lol

@daveaglick Any thoughts on how you want to handle this?

@daveaglick
Copy link
Member Author

@MisinformedDNA Almost certainly deprecate it. It's a fun little module that produces life-like text following user-specified patterns, but AFAIK it never had any real use cases and no one is using it in production. I guess in theory it would have been used for mock-ups and placeholder text, but there are plenty of online generators for that.

@daveaglick
Copy link
Member Author

@MisinformedDNA BTW, thanks for jumping in with all the help recently. I've been off on a little tangent but my focus is back here now so I'll hopefully start reviewing PRs and finishing the push towards .NET Core in the next couple days (or next week at the latest depending on how soon I can get some OSS time).

@eatdrinksleepcode
Copy link
Contributor

"little tangent" :)

@daveaglick
Copy link
Member Author

Getting closer everyone! @MisinformedDNA has helped unblock our remaining modules and @RLittlesII is helping with Wyam.Hosting which is the last remaining core library. The client story is coming together in #668.

I'm going to focus on some bug fixing before getting another release in the 1.x line out the door later this week or next and then that'll probably be it until 2.0 betas (unless other major bugs crop up in 1.x).

@daveaglick
Copy link
Member Author

daveaglick commented Oct 25, 2018

An update (I know it's been a while):

  • Wyam.Hosting has been updated to the latest ASP.NET Core 2.x is now fully .NET Standard and no longer uses Fleck for LiveReload support (it's now using raw ASP.NET Core WebSockets)
  • Wyam.Razor has been updated to ASP.NET Core 2.x (the Razor engine API totally changed between 1.x and 2.x)

I'm going to do a release in the next couple days (maybe even later today) with the updated Wyam.Hosting and Wyam.Razor bits. At that point every supporting library will be targetting .NET Standard.

The only thing left is the client. I have big plans for how Wyam should work in the future (#668), but I've decided to scale back Wyam 2.0 and make it a straight .NET Core release of what we've already got to get it out the door sooner. I expect the existing client won't take long to port (there isn't that much there) so expect a final Wyam 2.0 release with full .NET Core support in the coming weeks. Then I'll start working on the vNext client story for Wyam 3.0 - and I really hope that doesn't take as long as this did.

@daveaglick
Copy link
Member Author

Wyam 2.0 was just released, very happy to finally close this issue

@gijswijs
Copy link

Congrats Dave, and everyone involved on making this happen. Very impressive feat.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
General Enhancement New feature or request
Development

No branches or pull requests