-
Notifications
You must be signed in to change notification settings - Fork 3
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 Support? #2
Comments
Well... That was not planned at all 😄 |
Currently, if I try to add (as a NuGet package) either MrAdvice or StitcherBoy to a .NET Core application, the action fails. Perhaps all that's needed is re-packaging of the tools in a way that would support a DNC project but I don't know if that's even possible. The one thing I cannot do is wait... but that's my problem. ;) |
MrAdvice can run as a command-line application (this is totally undocumented, but was very helpful to debug it). However, you'll need to do some plumbing by yourself, such as setting the post-build step and parameters. |
OK, that sounds like a good start! 😄 but... correct me if I'm wrong here, wouldn't I still need to reference the MrAdvice DLL to create my advices, pointcuts etc from within my DNC source code? 😨 |
Yes, you need the reference to MrAdvice.dll, but this can also be made manually (by downloading the package from nuget, extracting it, and referencing the right dll). |
I'm going to try this and hopefully get out of your hair... 😃 |
OK, so here's an update: I managed to activate the MrAdvice Weaver Task properly on my DNC project! 😄 That's the good news because StitcherBoy doesn't require changes. However... I ran into exactly the same problem as I did with MrAdvice, i.e. MrAdvice.Weaver couldn't properly load the MrAdvice DLL! Is it possible that it's not working because @(ReferencePath) and @(ReferenceCopyLocalPaths) are coming up empty?? 😨 |
Another quick update... I passed MrAdvice.dll in the ReferencePath parameter and it looks like the Weaver has done it's job... that's the good news. The bad news is that the project doesn't run, but I'll report this as a MrAdvice issue. I think you can close this issue if you'd like... |
Hey, Pascal. Is still necessary to do to migrate MrAdvice to .NET Core? What do you think? I've done some work by migrating StitcherBoy to netstandard2.0 here https://github.com/AlexanderButs/StitcherBoy and loaded this package as a nuget into MrAdvice as a netstandard2.0 dependancy. Could you have a look on my changes and maybe i'll send a PR? (But you will need to do some work related to nuget release). Also we can discuss further work to do to migrate MrAdvice to .NET Core - as I understand I need to migrate Blobber as well to be able to pack MrAdvice into one package. Am I right? Alex. |
Hi Alexander, I understand the lot of forks you made recently 😉 How would consider the final Mr Advice for .NET Core? Can it run as a build task? How otherwise? Once we agree on where we need to go, we'll try to see how to go there. |
Yeah, we are in .NET Core transition state and I have some time to help you with this library so why not :) Idea is the next - MrAdvice will work the same as it does right now. Everything I need to do is to migrate actual MrAdvice.dll to support net461 and netstandard2.0, make MrAdvice.Weaver.exe compatible with net461 and netstandard2.0 (put these to two separate folders) and use proper weaver inside msbuild task depending on framework target you are building to. For all that stuff we need to migrate StitcherBoy and Blobber as well as I understand. StitcherBoy is almost done by me - need to test a little bit on your side and release to nuget. Your thoughts? :) |
How about the references to Microsoft.Build assemblies? Are they still available? |
Yes, they are. You can look inside my fork how they are used for different target frameworks. I use conditional reference there. |
OK, so I guess moving to .NET Standard is the smart thing to do :) I'm currently reviewing your changes |
I don't use the latest Microsoft.Build* packages as they don't target netstandard2.0 unfortunately. I guess they are (Microsoft) in transition state as well and in the future they will target netstandard2.1 or something like that. |
I reviewed you code, there are some hard-coded version numbers, except that this is probably OK. |
I will have a look. Thanks :) |
What version number? Referenced packages or StitcherBoy library itself? |
"1.3": StitcherBoy version in .nuspec file |
Yeah, my bad. Thanks for notice :) Will fix that and will make a PR. |
I brought back all assembly information to AssemblyInfo.cs and ProductInfo.cs except version number. Also a small copy paste of author and description inside nuspec file because of NuGet/Home#4234 |
Also it's needed to change deployment script because right now nuget package should be created by this command: dotnet pack StitcherBoy.csproj /p:NuspecFile=StitcherBoy.nuspec -c Release |
Hello, Pascal. My update: I made MrAdvice works in dotnet core environment :) To do that I ported StitcherBoy and Blobber to netstandard2.0 and made necessary changes. Also I ported MrAdvice itself to netstandard2.0+net461. I tested it out on test projects and it works fine for both netstandard2.0, netcoreapp2.0 and net461. But I have two major problems:
Also I didn't work with build process related to appveyor work. I guess it should be done in the very end. Do you have some time to help me with that? I pushed all my changes to my forks and they should work. If you have some time I can tell you how to build all nuget packages and make MrAdvice package. |
What happens on failing tests? Maybe the weaving does not work correctly? It could be worth the try upgrading dnlib in StitcherBoy. |
It fails during building stage. Weaving target just fails and that's all. Without any logs. I tried to pass "-v d" to msbuild to get full logs but no result :( |
This may be related to dnlib, so try upgrading it in StitcherBoy and then rebuild MrAdvice. |
ok, i'll try this. thanks for the hint. |
Unfortunately, it doesn't help. I've got next with detailed logging during build unit test project: |
There is a catch that mutes exceptions (as far as I remember) in StitcherBoy. Something probably happens there, you need to log the exception so you can diagnose it. |
I added some logging into the very beginning of weaving process but didn't get any logs. |
So we can probably guess that the assembly load fails, on the assembly itself or dependencies. How do you test the weaver? Do you specify dependencies explicitly? |
Probably, and I don't know how to investigate that :( |
The weaving process itself I tested on a test project - create new nuget packages for all 3 projects (blobber, stitcherboy and mrweaver) and use it in the test project. Everything works fine there. |
How can I help? Is the project where the error can be seen avaible? |
Maybe you know how to investigate those issues? And sometimes it's useful to show work to someone else :) Thanks for you help in advance :) |
I think it is good to change this project to netstandard 2 or 2.1, for this work we must remove microsoft.build.evaluation dependencies or we must find some alternative for it. |
Hello Pascal :)
I hate to be a pest, but do you think there's any chance for .NET Core support for this?
Thank you for the time and effort!
DB
The text was updated successfully, but these errors were encountered: