This is a quick tip on debugging Windows services or anything that runs as a seperate thread. In other words, if you have to attach to that process to debug it, and you have the source code, the following tip will make it easy to debug.
A Windows service usually runs automatically, it is designed to run as a continuous service and, therefore, spawns one or more threads to do the actual work. This happens very quickly. As such, it is difficult to attach to the process (Alt+P) in time to properly debug the service and attach during a specific part of the execution. As a multi-threaded app, it becomes cumbersome and painful to debug. Fortunately since Visual Studio 2015 that we can vote invoke that allows us to attach to the process through the Visual Studio just-in-time debugger. It’s super simple, call:
Use this call anywhere in your code where you want the code to break into Visual Studio. It will invoke a Visual Studio just-in-time debugger prompt:
Make your selection and debug. Happy coding my friends.
Hi, yes it has been a while. Its been a brutal year. I now have 4 girls, two recent twins. Probably doubled the gray hairs on my head by now. Had to move to a bigger home. Had to get a minivan to accommodate the bigger family. After moving into the house, I have been fixing things for 3 months now … an still not done. There’s much more as well. Nonetheless, here I am … now to CEWS (Content Enrichment Web Service).
So there are many articles out there, between several I was able to get something working. Lets start with the basics:
Content Enrichment is a process by which you can add/modify/enhance metadata to the search index directly.
Content Enrichment does not add metadata to the actual document or list item.
Content Enrichment only works for on-premise farms. Thus, not Office 365.
Content Enrichment is deployed as a web service.
Content Enrichment can be great if done properly … poor code will slow down search very significantly.
The basic steps for creating and deploying a CEWS are:
Using Visual Studio 2012 or 2013, create a WCF Service Application project.
Create your Content Enrichment Service
Implement the IContentProcessingEnrichmentService interface from the Microsoft.Office.Server.Search.ContentProcessingEnrichment assembly which you must reference (located at c:\Program Files\Microsoft Office Servers\15.0\Search\Applications\External\microsoft.office.server.search.contentprocessingenrichment.dll by default; unless you installed SharePoint somewhere else).
Register your Content Enrichment Service with Powershell
Something I find very useful when working with clients is to help them distinguish each environment between development (DEV), testing (TEST), Staging (STAGE) and Production (PROD). Some clients may have even more environments. Lets take a look at the change in the UI first…
This is the Out of the Box label (Before):
This is the customized label (After):
So how do we do it, we use PowerShell to change the label at the web application level: