-
Notifications
You must be signed in to change notification settings - Fork 73
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
The package causes wrong version of 'System.Private.CoreLib' to be referenced in my app #113
Comments
can you provide your examle project without reproduction steps? |
Hi, Place breakpoints as in the screenshot and then run the app in Inspect the value of the Also, I can inspect the object by clicking grey Also, the app prints the current referenced assemblies, which may help you figure out the root of this issue. |
Hi @Ralf1108, Is the provided information enough for you? Are you able to reproduce the issue? |
Hi @Ralf1108 , Is there any news regarding the issue? |
Hi, checking your reproduction project I can't reproduce what you observed.
I see that you use Rider as IDE... I use Visual Studio 2022... so this could be a difference in the debugger logics. |
Ah, you already stated that you tried the latest version. Can you retry it with Visual Studio 2022 on your machine? |
Hi @Ralf1108, If there is anything I can help with, please let me know. |
here are my installed versions: `C:\Users\Ralf>dotnet --list-sdks C:\Users\Ralf>dotnet --list-runtimes |
Hello, |
OMG. I tried to uninstall and install the latest version of the MethodBoundaryAspect package, not from Rider but from Visual Studio, and it works great now! It looks like VS installed some extra stuff, while Rider didn't do that. Thank you, @Ralf1108, for all your effort and your time! Please feel free to close the issue as solved! |
Glad that you figured this out. Maybe you can provide a diff between the different installation changes? So if something similar occurs in future we can identify the issue faster. |
Hi @Ralf1108, The issue is not actually fixed... And here is what the app prints when it's built with Please, try to clean and build the solution with these commands, then run the app and see what it prints. |
If I use So you should be able to try different ways at least to build the solution. |
wow strange. Running via "dotnet clean/build" and execute: I think MSVS uses MSBuild and not "dotnet build". But it is rather interesting that there are different outputs. So.... I am a little confused what is the issue here and how to solve it 😵 |
I'm glad that you can reproduce the issue. It's a great step for resolving it. |
Ah... issue is that somehow "dotnet build" adds the reference to "System.Private.CoreLib, Version=7.0.0.0" but it shouldn't because your example project is set to "net6.0" |
Yes, exactly. That's the most confusing part. But it only "works" when "MethodBoundaryAspect" is included in the assembly. When it's not included in the assembly, there is no reference to "System.Private.CoreLib" at all |
I had a lot of searching and conversations with Chat GPT, and it suggested several things. For instance, to use these guys in my project file Install the latest version of .NET 6.0 SDK and thy the
Transitive Package Resolved
So, from my side, I don't have any even potential solutions to this issue. I hope you find something interesting on the web or in the package. |
Hi,
I'm getting the following error when I try to debug the code of my .NET 6.0 application:
Assembly 'MyApp' with identity 'MyApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' which has a higher version than referenced assembly 'System.Private.CoreLib' with identity 'System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'
The project named
MyApp
(Console application) uses .NET 6.0 as a target framework, but for some reason,MethodBoundaryAspect.Fody
package causesMyApp
to useSystem.Private.CoreLib, Version=7.0.0.0
.Yes, I'm sure that this referencing issue is caused by
MethodBoundaryAspect.Fody
because when I uninstall it, everything works great. WithMethodBoundaryAspect.Fody
included in the assembly ofMyApp
, the project can still be built and run without errors. Still, when I'm trying to debug theMyApp
project, I cannot inspect any variables/objects, so the entire debugging process is useless, which is extremely bad for me.Also, the issue is independent of IDE. Rider allows me to inspect variables of the current context, but only inside the Debug window and with plenty of limitations. Visual Studio doesn't allow inspecting any variables at all, and the debugger is useless. In both cases, the breakpoints worked as before. At least I didn't notice any errors related to breakpoints.
I tried to use different versions of your package, for instance,
[v2.0.148]
,[v2.0.110]
, and two or three more, but there is no difference. I still get the error.If you need any more information, please don't hesitate to let me know.
The text was updated successfully, but these errors were encountered: