-
Notifications
You must be signed in to change notification settings - Fork 45
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 #71
Comments
Take into account project.json stuff - right now to make it working you should add post build step to project.json (because there is no msbuild for .NET Core and your build target is useless). But MS is planning to move project.json and xproj system back to msbuild and csproj. So read info about that first of all. |
Some documentation: https://docs.microsoft.com/en-us/dotnet/articles/standard/library |
The best option is to wait for .NET Standard 2.0, which is supposed to be supported by all recent frameworks. |
Hello Pascal, First, I want to say that MrAdvice is absolutely wonderful! However, I need it to work with .NET Core projects and as such I've tried to add the MrAdvice target to my project and got the following result:
This appears at the build output right after the project properly builds. Again, wonderful product! Thanks, |
Hi DB, And of course, I'm glad that you like Mr. Advice 👍 |
I've released a version 2.4.1-test1 which probably won't solve your problem (it solved mine, but I'm not sure they are the same). |
Hello Pascal, and thanks for the speedy reply! :) My issue is that I am actually trying to use MrAdvice (NuGet package 2.4.1-test1; just updated to it) in a .NET Core Console app project (*.xproj project.json files). I took exactly the same code I've created when testing MrAdvice on my initial project (.NET Framework 4.6.1) and your NuGet package doesn't even modify the .NET Core project files to include the Weaver. When I "forcibly" added the Weaver to the .NET Core project, that resulted in the error I showed you before. I will attempt to replicate this with your newest version and see what happens... stay tuned... ;) |
Don't hurry, I think I have the exact same problem as you right now, so wait until a |
OK, thanks... By the way, have you started to adjust everything to work with the Mono.CeCIL .NET Core library version? Or do you have any other recommended CIL Re-writing Library you prefer working with? |
My problem was just a debug parameter, so nothing to fix and no |
Does dnlib support .NET Core? |
Running from a .NET Core application? I have no idea... |
Thanks for the advice! 👍 I'll check dnlib out and see what I can come up with. |
Hi Pascal... my journey continues 😉 This is what VS2015 reports when I build my DNC test project:
And this happens as soon as I try to run the program:
Any ideas what's going on? |
Probably: this means that I misused the |
I'll try to update to v2.4.3 and see how it goes... Thanks! 😄 What do you know... it works! Whatever you did in 2.4.3, properly activates the advice now! I don't think your v2.4.3 nuget package modifies the project to add the weave target, but this is a start! 😂 |
What package do you use? |
OK, first of all there's a change in how the NuGet manager works with .NET Core projects. Instead of a "packages" directory that is a part of your solution folder-structure things get stored under the user-home directory. As if that's not enough, the invocation of the MrAdvice Weaver needs to slightly change as well so your old MrAdvice.Targets file requires some modifications. I decided to create my own Targets file which I import at the end of my .xproj:
This is what my Targets file contains:
As you can see, I am using NetStandard16, and I'm happy to say that the same Targets file works for DNC App projects as well as DNC WebAPI projects! 😀 |
I've included two test DNC projects that use MrAdvice... enjoy 😉 |
Hi Pascal, Just wanted to check if there are any new developments regarding MrAdvice and .NET Core projects (NetAppCore1.0/NetStandard16)? Thanks, |
I'd love to! However, regarding all compatibility issues (and perhaps a part of laziness), I'll probably target NET Standard 2.0 only. |
But if you're willing to help, you're welcome! |
Then until NetStandard v2.0 comes, I'll continue to use my MrAdvice.targets file in my .NET Core projects. Thanks for everything! 😄 |
OK, so I'm trying to figure out how to simplify and automate my MrAdvice.targets file and add it to a NuGet package/template... but I noticed something funny. I keep getting a warning when my projects include references to other DLL's. I assume what I'm doing wrong is passing only the reference to my own DLL instead of all the references participating in the project, but I'm not sure how to do that. Do ReferencePath or ReferenceCopyLocalPaths have anything to do with this? |
Don't mind about this, I have the same issue, and I need to solve it... I think I may have left some debug information somewhere... |
I'm not worried about this regarding DLL's that are not supposed to contain my Advice attributes, but what about projects that have several DLL's in them that do contain multiple Advice attributes between them? |
Does this happen? |
Not sure of this, because |
At first peek it does. You can check it here https://github.com/dotnet/cli/blob/master/src/dotnet/commands/dotnet-build/BuildCommand.cs But it does this not via msbuild executable itself but via dotnet and MSBuild.dll |
I have the same issue on Appveyor with MrAdvice 2.8.8 What is the last update to this issue? and is there any workaround about it? |
We need help for this. First of all, the weaver should be able to run from command-line. Could you try? The documentation is here: https://github.com/ArxOne/MrAdvice/wiki/CommandLineWeaver |
No it couldn't run from command line, because
|
Could you try with https://www.nuget.org/packages/MrAdvice/2.8.9-embed1 ? I've embedded some of required Microsoft assemblies. |
Another issue is I think dotnet/msbuild#4786 we must change MrAdvice.NetStandard project type. |
What problem do you have? Could you provide a log or anything that shows the error? |
If you open this project in visual studio 2019 you can see the error like below
|
I add PR #156 to resolve some issue in building this project under Visual Studio 2019 and netstandard 2 |
@picrap I upgrade my package to 2.8.9-embed1 but does not change anything
|
@picrap I think the problem is dotnet/msbuild#2111 (comment) and we must create multiple Weaver.exe for each platform |
For information, I'm working on it. I'm currently moving the source library, |
Hey, Pascal, look at my forks. They are already ported to .net standard. I'm not sure embedding Microsoft.Build.* assemblies is a good idea, they may have another dependencies which require full net framework. |
OK, "embedding" was the wrong term. I meant "include the dependencies as packages". |
Also, I'm removing all references to |
But this won't work in .net core universe as I remembered. |
Oh, I'm sorry. Yes, you need to consume nugets for net core and just reference assemblies for full framework. See my fork, it works. |
Strange, because Microsoft packages depend on .NET Standard 2.0 and .NET framework 4.7.2. .NET Standard is supported by .NET Core, so it should work, shouldn't it? |
I can make a pull request if you'd like. Just check my fork and if everything is ok i'll do this tomorrow. |
I'd like to see if all dependencies can be removed from |
Great! Tell me if you need any help :) |
@AlexanderButs it works, you can use version 2.9 with |
Hey, Pascal. Unfortunately I can't verify your changes as I switched project and don't work with MrAdvice any more. But nice to hear you've done this. Good job! Alex. |
@picrap Thanks for attention, but my question is which PR arrive this feature? |
It is already working in release 2.9 |
Because right now, it's no 😢
The text was updated successfully, but these errors were encountered: