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

.NET Core Port #2

Closed
droyad opened this issue Aug 24, 2017 · 14 comments
Closed

.NET Core Port #2

droyad opened this issue Aug 24, 2017 · 14 comments
Assignees
Projects

Comments

@droyad
Copy link

droyad commented Aug 24, 2017

We use your library, so thank you for making it available and maintaining it. We are looking at moving to .NET Core, and I'm wondering what your plans are for making a .NET Core version available as well.

I've attempted a port of the TaskService projects, and the only bit I found that wasn't supported is the WindowsImpersonationContext and the EventLog stuff.

@dahall
Copy link
Owner

dahall commented Sep 13, 2017

I'm mostly there with the project updates I just posted. I now just need to figure out how to build both the .NET Standard assembly and the multiple .NET Framework assemblies at the same time. All the files and project are updated and I just have the .NET Standard build line commented out.

@droyad
Copy link
Author

droyad commented Sep 13, 2017

@dahall Just add netstandard2.0 into existing TargetFrameworks element in https://github.com/dahall/TaskScheduler/blob/master/TaskService/TaskService.csproj#L4

@dahall
Copy link
Owner

dahall commented Sep 13, 2017

Done, and it works. You have to add it after the .NET Framework builds or VS has a problem. I just checked in those changes. I will do some testing and tweaks to make sure the disabled features fail gracefully and then release a NuGet package with the support.

@droyad
Copy link
Author

droyad commented Sep 13, 2017

oh, Awesome! Thanks for that. Interesting about the order, I did have an issue where the restore didn't work.

@dahall
Copy link
Owner

dahall commented Sep 22, 2017

Just a status update: I am waiting to push the code until I can adequately test it in a UWP or console app. I can't do that until MS releases VS 2017 15.4. So, as soon as that update comes out, I will test and then release a NuGet with netstandard2.0 included.

@dahall
Copy link
Owner

dahall commented Sep 29, 2017

I figured out a way to test ahead of VS15.4 and have run into a big problem. .NET Standard 2.0 does not support COM IEnumerable. This interfaces is used extensively by Microsoft in the base library. I'm looking for work arounds, but, so far, have come up empty. This may need to be put on hold until MS added COM support to .NET Standard. Thoughts?

@droyad
Copy link
Author

droyad commented Oct 3, 2017

Which part of the code has those IEnumerables?

@dahall
Copy link
Owner

dahall commented Oct 3, 2017

The native COM objects IActionCollection, ITriggerCollection, IRegisteredTaskCollection and IRunningTaskCollection are all native COM interfaces that support a special COM version of IEnumerable. The .NET interop code that handles working with COM doesn't implement that special IEnumerable so it can't convert it to the .NET version.

@dahall dahall self-assigned this Oct 4, 2017
@kswierszczyk
Copy link

Same issue w/ the IEnums. I'll be looking at possible solutions also as I'd like to migrate a project to .NET core. Has there been any word from Microsoft as to whether they'll be adding COM support to .NET Standard?

@dahall
Copy link
Owner

dahall commented Oct 15, 2017

Microsoft has not even hinted as of today on what will be a part of the next .NET Standard release.

@droyad
Copy link
Author

droyad commented Nov 16, 2017

It looks like they don't intend to support GetEnumerator(), https://github.com/dotnet/corefx/issues/19731

However, I think I have found a work around. It works for the TestTaskServiceConsole app. See PR #35

@dahall
Copy link
Owner

dahall commented Nov 16, 2017

Wow. Thanks for this workaround. How comfortable are you that the changes in your PR do not change any of the API (breaking change)? I'd be glad to just pull them straightway, but don't want to break anyone's existing code.

@dahall
Copy link
Owner

dahall commented Nov 16, 2017

Added to release 2.7.2! Thanks for your help.

@dahall dahall closed this as completed Nov 16, 2017
@droyad
Copy link
Author

droyad commented Nov 16, 2017

@dahall No worries. I didn't test all the methods, just the enumerating the tasks. I did just realise that I incorrectly 0 indexed the other arrays, but it doesn't look like that made it into master.

Thanks, I'll try it out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Library
  
Awaiting triage
Development

No branches or pull requests

3 participants