1

Using Sitecore 8.2, Im spending a fair bit of time trying to figure out which packages to include and there doesn't seem to be helpful documentation for this.

For example, I have some code which uses [AuthorizedReportingUserFilter] and I believe that's contained in the name space Sitecore.Cintel.Endpoint.Plumbing, but there isn't a package with Cintel in the name.

This is just one example and may be simple to find the package, but Im interested to hear if there's a way to determine the package quickly that can be used for all namespaces.

2

2 Answers 2

2

Finding Matching DLLs

There is no documentation, and unfortunately it's sometimes an educated guess which DLL contains the code you need to reference.

Since you know the Class/Namespace you are looking for, you can use a search tool to search through all the DLLs on the filesystem to find a match. I have found this to be the quickest way to narrow down to at least a set of matching DLLs. My personal preference is GrepWin from Stefan Tools, use whatever similar tools you prefer:

grepWin

Note that this is a grep tool and you can use regular expressions if you need to find matches using some extra logic.

Verifying using a Decompiler

You can use a decompiler to confirm the match is correct, or if you find multiple matches load them all to find the correct DLL. My personal preference is JetBrains dotPeek Decompiler but use which ever similar tool you prefer. You can use the Go to Everything / Type (Ctrl + T) or Go to String (Ctrl + Alt + T) from the navigate menu to help find the type.

dotPeek

If you are already inspecting code in a decompiler then it's possible to sometimes figure out the DLL name from the using statements that are referenced in the code. It may also be possible to inspect the references:

dotPeek references

Otherwise over time with experience, you learn which DLLs (most likely) contain the code you need. I've found the above techniques to serve me well though.

2
  • Worth noting that Resharper does a pretty good job of figuring this out as well. Both via references but even NuGets.
    – Mark Cassidy
    Commented Dec 8, 2017 at 15:37
  • @MarkCassidy I agree, but unless one of the projects has a reference to "Sitecore.Cintel" (in this case) it generally did not work for me. Not sure if it caches references or how it resolves NuGet without a reference elsewhere in the solution... But a very good point.
    – jammykam
    Commented Dec 8, 2017 at 15:41
1

Downloading the Sitecore Zip Files for DLL's

I have found a lot of success taking the WebRoot Zip file for various Sitecore versions that I am wanting to target, and unzipping the bin directory to a location.

Using dotPeek to decompile and search

From there, using dotPeek, which is a free utility, and open various bin directories in it. I keep every version of Sitecore in the list.

From there, you can search for a class, type, or even a string (anything really), and the search results will direct you to exactly which DLL is it located in.

Finding the NuGet Package

Once you know what DLL you're looking for, then it's a matter of finding it on the Sitecore NuGet repository. There are two versions of almost every DLL available:

  1. Library with Dependencies
    1. This will show up like Sitecore.Kernel.DLL
    2. Installing this DLL will also install ALL dependent NuGet packages
    3. This generally installs more references than one would like, so the alternative is to install the NoReferences DLL.
  2. Library with No References
    1. This will show up like Sitecore.Kernel.DLL.NoReferences
    2. This will ONLY install the single library reference into the solution.

Hope this helps!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.