C
C#4w ago
Mango

Could not load file or assembly…

Could not load file or assembly 'System.Diagnostics.DiagnosticSource, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.
29 Replies
Mango
Mango4w ago
Happening when app runs. Bringing redirects have been added to every app.config and web.config there is in the solution. Don’t know what else to try.
ACiDCA7
ACiDCA74w ago
well does the file exist in the output dir? and if it does which version is it
Mango
Mango4w ago
That’s the thing. I don’t know which assembly needs it
ACiDCA7
ACiDCA74w ago
you are starting an app that throws that error... in the folder where oyu are starting the app from is there a i asume a System.Diagnostics.DiagnosticSource.dll?
Mango
Mango4w ago
It’s not in the bin directory of the startup project If that’s what you mean
ACiDCA7
ACiDCA74w ago
jea that was what i meant
Mango
Mango4w ago
Hmmm, that’s a problem then Why would it not be there
ACiDCA7
ACiDCA74w ago
are you using any buildevents to copy dlls or so?
Mango
Mango4w ago
Not that I know of
ACiDCA7
ACiDCA74w ago
hmm in the obj folder there is projectname.assets.json, can you open that and search for System.Diagnostics.DiagnosticSource.. maybe you can find what is depending on it there
Mango
Mango4w ago
I have no such file This is a netfx project fwiw
ACiDCA7
ACiDCA74w ago
ah its usually hidden in the same folder as the bin folder
Mango
Mango4w ago
Not obj?
ACiDCA7
ACiDCA74w ago
?
Mango
Mango4w ago
You said in the obj folder Obj and bin are separate
ACiDCA7
ACiDCA74w ago
k if nothing else helps.. there are tools like depencywalker that tell you which dll is dependent on which dlls... ilspy can do this rudimentarly aswell jea i meant obj and bin are side by side in the same folder asuming you didnt change outputpath
Mango
Mango4w ago
Yeah that file is not there
ACiDCA7
ACiDCA74w ago
ok
Mango
Mango4w ago
In either bin or obj
ACiDCA7
ACiDCA74w ago
lemme guess this is not a sdk style project and you are using nugetreference.json or however it was calle din the past..xD
ACiDCA7
ACiDCA74w ago
GitHub
GitHub - mikehadlow/AsmSpy: Simple command line assembly reference ...
Simple command line assembly reference checker. Contribute to mikehadlow/AsmSpy development by creating an account on GitHub.
ACiDCA7
ACiDCA74w ago
GitHub
GitHub - icsharpcode/ILSpy: .NET Decompiler with support for PDB ge...
.NET Decompiler with support for PDB generation, ReadyToRun, Metadata (&more) - cross-platform! - icsharpcode/ILSpy
ACiDCA7
ACiDCA74w ago
two great tools to find stuff like this
Mango
Mango4w ago
Maybe. I’m not sure
ACiDCA7
ACiDCA74w ago
well doesnt matter.. just try one of these tools
Mango
Mango4w ago
I heard dotPeek can do this too
ACiDCA7
ACiDCA74w ago
sure i dont care use whatever needed.. if you prefer dotpeek use it i just dont see the need to install some paid software if there are great oss solutions
Mango
Mango4w ago
I actually have no idea what DLLs I need to be inspecting All of the ones from my assemblies in the bin?
ACiDCA7
ACiDCA74w ago
jea just load them all then use the search in dotpeek and ilspy asmspy would load the dependencies recursively based on startassembly