Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 VA 2393: HCB shows duplicates?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Uniwares
Tomato Guru

Portugal
2318 Posts

Posted - Nov 16 2020 :  07:30:06 AM  Show Profile  Reply with Quote
class definition is:
internal class CuttingOperation : Operation

and the base class is:
public class Operation : IDisposable




Solution with seven C# 8.0 projects, .NET 4.8,
Referenced assemblies:
assemblyref://Interop.CoreScanner&
assemblyref://Microsoft.ReportViewer.Common&
assemblyref://Microsoft.ReportViewer.ProcessingObjectModel&
assemblyref://Microsoft.ReportViewer.WebForms&
assemblyref://Microsoft.VisualBasic&
assemblyref://SecuBSPMx.NET&
assemblyref://System&
assemblyref://System.Configuration&
assemblyref://System.Core&
assemblyref://System.Data.Linq&
assemblyref://System.Management&
assemblyref://System.ServiceProcess&
assemblyref://System.Xml.Linq&
assemblyref://System.Data.DataSetExtensions&
assemblyref://Microsoft.CSharp&
assemblyref://System.Data&
assemblyref://System.Deployment&
assemblyref://System.Drawing&
assemblyref://System.Net.Http&
assemblyref://System.Windows.Forms&
assemblyref://System.Xml&projref://ExcelReader&projref://Lynx&projref://FingerPrintReaderBase&projref://SecuGenReader&projref://KeyboardControl&
assemblyref://mscorlib

*edited to add new lines*

Edited by - feline on Nov 17 2020 10:46:25 AM

Uniwares
Tomato Guru

Portugal
2318 Posts

Posted - Nov 16 2020 :  09:23:40 AM  Show Profile  Reply with Quote
Looking at a class derived from System.Windows.Forms, I see the following:
* methods implemented in the Forms class are repeated 3 times
* events and delegates in this class show only once
* properties and other variables once too.
* some of its base classes show with members 3 times repeated, others 6 times
* methods from interfaces are either 1, 2, 3 or 6 times repeated

Go to Top of Page

Uniwares
Tomato Guru

Portugal
2318 Posts

Posted - Nov 16 2020 :  10:03:14 AM  Show Profile  Reply with Quote
Now looking at another solution, one quite large C# 8.0 project, some smaller C# projects, there are some weird things showing up:
A class derived from DbContext (EntityFramework) shows a mess:
* some overridden methods show twice
* some properties appear twice, once with the full definition in the EntityFramework base, the other as written in the class
* interestingly, the EntityFramework classes all show up correctly, each member as it should

There is a interface though that shows up twice, not sure if thats correct:
one is
Microsoft.EntityFramworkCore.InfraStructure.IInfrastructure
and the other is
IInfrastructure<IServiceProvider>
yet both refer to the same interface.

Also, all interfaces are shown to derive from Object, not sure if thats really correct or even useful here, see also https://stackoverflow.com/questions/3236305/do-interfaces-derive-from-system-object-c-sharp-spec-says-yes-eric-says-no-re

Edited by - Uniwares on Nov 16 2020 10:21:05 AM
Go to Top of Page

Uniwares
Tomato Guru

Portugal
2318 Posts

Posted - Nov 16 2020 :  10:28:05 AM  Show Profile  Reply with Quote
Visualization is consistent between VS 16.9.0 Preview 1.0 and 16.8.1
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18724 Posts

Posted - Nov 16 2020 :  1:13:01 PM  Show Profile  Reply with Quote
Seeing the same thing here, but so far no idea where the duplicates are coming from:

case=143096

zen is the art of being at one with the two'ness
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18724 Posts

Posted - Nov 16 2020 :  1:26:01 PM  Show Profile  Reply with Quote
I am seeing different numbers of repeats in different versions of the IDE as well. Something is driving this, but I am not sure what.

I didn't check a class derived from form, but doing so, as you say, different numbers of duplicates. This just gets more strange.

At least I can answer the question of all interfaces being shown derived from Object. VA View is not trying to show you a proper inheritance graph, instead it is aiming to just show you a list of all of the inherited classes, without showing or explaining their exact relationship with each other.

zen is the art of being at one with the two'ness
Go to Top of Page

Uniwares
Tomato Guru

Portugal
2318 Posts

Posted - Nov 16 2020 :  2:31:29 PM  Show Profile  Reply with Quote
As for the Interfaces, well, there is no inheritance of object, the object should appear only where an inheritance is actually possible. Even an interface with default implementations doesnt really inherit from object.
Go to Top of Page

Uniwares
Tomato Guru

Portugal
2318 Posts

Posted - Nov 17 2020 :  05:55:20 AM  Show Profile  Reply with Quote
I might be onto something (or not). I was looking for instances of System.Windows.Forms assemblies on my computer, and I found 6 versions. That might be now an coincidence that I see methods in System.Windows.Forms classes appear 6 times, but strange it seems.
Same works for the EntityFramework library.
Could it be that VA shows ALL existing versions of the assemblies it found in the GAC?
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18724 Posts

Posted - Nov 17 2020 :  10:44:35 AM  Show Profile  Reply with Quote
How are you finding the "Referenced assemblies:" information?

Trying to figure out how many versions I have in the GAC, I ended up on this page:

https://stackoverflow.com/questions/19980650/where-is-the-location-of-gac#19981061

where the most useful answer seems to be:

>> The way that I always programmatically detect what versions of the .Net framework are installed is to look at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP ... the sub-folders indicate installed versions.

but checking this doesn't help. I am getting a different number of repeats on two different virtual machines, which are using the same solution (but different versions in time), and they are both giving the same number of sub-folders in the registry for installed versions.

zen is the art of being at one with the two'ness
Go to Top of Page

Uniwares
Tomato Guru

Portugal
2318 Posts

Posted - Nov 17 2020 :  10:47:42 AM  Show Profile  Reply with Quote
Did a simple search for the DLLs, some of them are in the ".net packs" C:\Program Files\dotnet\packs, seems to apply only to the .NET standard and core.
Go to Top of Page

Uniwares
Tomato Guru

Portugal
2318 Posts

Posted - Nov 17 2020 :  10:56:35 AM  Show Profile  Reply with Quote
See this from my larger project:




And when copying from those:
public DbSet<Label> Labels{...}
Microsoft.EntityFrameworkCore.DbSet<Q7.Database.Objects.Production.Label> Labels

Its consistent, but where it comes from? There is only one. And as you see, even the comments are the same. The one with the file info, i can goto, the other not.
In this case, there is no other copy of the assembly either, just a debug one. I rebuilt VAs DB, cleared history and cache, still duplicates for my own code here.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18724 Posts

Posted - Nov 17 2020 :  11:06:23 AM  Show Profile  Reply with Quote
Let's assume I have no idea what I am doing here

Doing a file system search across the entire C: drive on one of my test machines for all files called "Microsoft.CSharp.dll" has returned 156 items. Clearly this isn't what you mean.

Based on the paths of the files, I have, among others, the following .NET frameworks installed, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7.2, so 8 versions just there.

zen is the art of being at one with the two'ness
Go to Top of Page

Uniwares
Tomato Guru

Portugal
2318 Posts

Posted - Nov 17 2020 :  11:12:04 AM  Show Profile  Reply with Quote
Basically yes thats what I did. Guess you chose an unlucky assembly, this one might be delivered with each app and not installed in the GAC. Try the Microsoft.EntityFramework*.dll, or System.Windows.Forms.dll or the System.Diagnostics
Go to Top of Page

Uniwares
Tomato Guru

Portugal
2318 Posts

Posted - Nov 17 2020 :  11:19:51 AM  Show Profile  Reply with Quote
As for .Net versions installed, I have .Net Core 2.0, 2.1, 3.0, 3.1, .NET 5.0, .NET Framework 2.0 up to 4.8, so pretty much all versions. From what I can see, when you have a .NET core solution, only the .NET Core and Standard libraries are available in VS. This might be a reason.
Go to Top of Page

Uniwares
Tomato Guru

Portugal
2318 Posts

Posted - Nov 17 2020 :  11:30:30 AM  Show Profile  Reply with Quote
I think I pissed it off. Now the HCB isnt showing me anything anymore in my .NET 4.8 solution. No symbol at all. But it works fine in the .NET Core 3.1 solution. This started after I cleaned the DB.
Also I noticed now that VA is definitely importing the .net packs after clearing the DB from "C:\Program Files\dotnet\packs", shows up in the status bar when launching VS.
Go to Top of Page

Uniwares
Tomato Guru

Portugal
2318 Posts

Posted - Nov 17 2020 :  11:46:53 AM  Show Profile  Reply with Quote
So, working again now after restarting VS. I get still the same result. char[255] between entries, 6 copies of all methods, etc.
Concentrating on System.Diagnostics (but not limited to), I get in all kinds of solutions, .NET versions, VS versions, the very same result:


and copying to Notepad++:


The char[255] is visible in other editors too that support pasting the full range of characters.

Edited by - Uniwares on Nov 17 2020 11:55:17 AM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18724 Posts

Posted - Nov 17 2020 :  12:20:53 PM  Show Profile  Reply with Quote
The system.object duplicates seem to be a separate case to the duplicates from your own classes. Doing file searches for the dll's is just getting me massive numbers of hits, so this doesn't seem to be helping at all. Probably best to leave this for the developers to approach from the code side.

Looking into the duplicates in your class, I have an older solution from you, and looking at that, I randomly picked the file "NeedleChange.cs", which contains the namespace "Q7.Database.Objects.Production"

Showing this namespace in VA View lists 20 component classes, and I am not seeing any duplicates in any of their direct members. Are the duplicates in your classes stable after the symbol database rebuild and IDE restart? This is something that, in theory, we should be able to pin down and make sense of.

zen is the art of being at one with the two'ness
Go to Top of Page

Uniwares
Tomato Guru

Portugal
2318 Posts

Posted - Nov 17 2020 :  12:28:37 PM  Show Profile  Reply with Quote
Cant say at the moment, but will have an eye on it. You know, occasionally I have to do paid work too VA Bug hunting is just a sport.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18724 Posts

Posted - Nov 17 2020 :  1:11:28 PM  Show Profile  Reply with Quote
I do wonder how you have the time to keep me so busy! :) It's a sport you are very good at!

zen is the art of being at one with the two'ness
Go to Top of Page

Uniwares
Tomato Guru

Portugal
2318 Posts

Posted - Nov 17 2020 :  1:16:46 PM  Show Profile  Reply with Quote
Multitasking and a slow compiler are the secrets. The real question is why do I have to keep you busy (with stuff that already worked once)?
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18724 Posts

Posted - Nov 18 2020 :  08:48:47 AM  Show Profile  Reply with Quote
OK, I have managed to reproduce the duplicate entries in HCB problem for classes defined in the current solution. I did this by triggering the strange VA corrupted symbol database that can happen when a C# project uses NuGet packages

case=142203

so far you seem to be the only person who has run into this problem, and it is probably related to at least some of the other problems you are seeing. I have added notes about this problem to the bug report.

zen is the art of being at one with the two'ness
Go to Top of Page

Uniwares
Tomato Guru

Portugal
2318 Posts

Posted - Nov 18 2020 :  08:52:34 AM  Show Profile  Reply with Quote
Dont you love it to be special? hahahaha, well something is interfering anyway. Hope you (Wholetomato) figures it out.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000