MarkLTX / TracerX

Other
24 stars 15 forks source link

Warning in TracerX 9.5 #7

Open securigy opened 1 year ago

securigy commented 1 year ago

I usually use TracerX in .NET Framework projects and now it works well with async/await pattern and in .NET 7 app. However, I am building a library now that also needs to be instrumented and this library supposed to be compatible both with .NET 7 and .NET Framework. The only solution I could find was suggested by chatGPT that claims that if I build the library for .NET 2.0 Standard (not even 2.1) then it will be compatible with both .NET Framework and .NET 7. So that's what I did but then when I added NuGet package I see the warning in Visual Studio under Packages > TracerX-Logger (9.5.0): Package 'TracerX-Logger 9.5.0' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8, .NETFramework,Version=v4.8.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project.

Can I safely ignore this warning?

MarkLTX commented 1 year ago

I’m not 100% sure but I think so. The TracerX package targets .NET Core 3.1 so it should be OK to use with a project that targets .NET 7. My only concern is that your error message doesn’t mention .NET Core 3.1. I think you should check your project references and make sure the TracerX reference is to the directory that contains the .NET Core 3.1 version. I have found that simply updating a NuGet package doesn’t cause the project reference to use the latest compatible version of the package. Uninstalling and reinstalling the NuGet package does, though.

Also, DO NOT use Logger.InfoCall(), DebugCall(), etc. in methods that use await, or that call other methods that use await (which you might not even be aware of). I thought I had it working but not really. It might appear to work but it causes a memory leak.

From: Leon @.> Sent: Wednesday, June 21, 2023 1:28 PM To: MarkLTX/TracerX @.> Cc: Subscribed @.***> Subject: [MarkLTX/TracerX] Warning in TracerX 9.5 (Issue #7)

I usually use TracerX in .NET Framework projects and now it works well with async/await pattern and in .NET 7 app. However, I am building a library now that also needs to be instrumented and this library supposed to be compatible both with .NET 7 and .NET Framework. The only solution I could find was suggested by chatGPT that claims that if I build the library for .NET 2.0 Standard (not even 2.1) then it will be compatible with both .NET Framework and .NET 7. So that's what I did but then when I added NuGet package I see the warning in Visual Studio under Packages > TracerX-Logger (9.5.0): Package 'TracerX-Logger 9.5.0' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8, .NETFramework,Version=v4.8.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project.

Can I safely ignore this warning?

— Reply to this email directly, https://github.com/MarkLTX/TracerX/issues/7 view it on GitHub, or https://github.com/notifications/unsubscribe-auth/ABIDRD5EQ4HVNEMXDBFT7FTXMM4JLANCNFSM6AAAAAAZPELHLI unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

securigy commented 1 year ago

I worked with 8.0 and am working with 9.5.0 and so far I did not see any problems and I am using lots of async/await. It does not mean I do not believe you - I will leave it in my code since it is not going to ship any time soon and will be watching any problems if arise and let you know.

About versioning: the library that I am planning to be compatible both with .NET Framework and .NET 7 is using .NET Standard 2.0 and everything works well so far in .NET 7 application, except that warning. I tried to uninstall and re-install the 9,50 but it does not help the warning shows up the moment I re-install 9.5.0. I have no control where the .NET is looking for its libraries.

image