Friday, November 17, 2017

The best place to get started with XConnect is using Martina's documentation. It walks you through your basic XConnect console application.

Once you have this console app building start taking a look at the Jason Wilkerson blog articles on XConnect. Although tempting, do NOT start with Jason's articles. It is important that you get Martina's application working first and then start adding functionality from Jason's articles. The reason is that Martina's will do all the client certificate stuff properly and that is what you want for production.

I started myself with this console app and am now using Jason's blog articles myself. My hope is to build out a repository on GitHub along with a series of articles on how to integrate XConnect with a variety of other applications in hopes this will save others time doing this. If you are building an integration maybe we can collaborate and then add it to the repository for others to use.

When you create your project in Visual Studio 2017, if it defaults to creating your console app as 4.6.1 and you switch to 4.6.2 you may get an error about the root node. If you do it is a bug in the conversion. Check your app.config file and make sure it is formatted like this. In my case it removed the configuration node and put startup within appSettings.

Troubleshooting

Your thumbprint or certificate is not properly installed so you are being blocked from connecting to xConnect

Your application does not have access to the certificate (e.g. IIS user does not have permission)

You did not execute the script in the installation guide Post-installation steps.

On first install I had forgot to run the execution script, doh. The second time around it was the second one but it was a step further it was not the certificate itself but a policy applied to my laptop by IT that was not allowing the root authority because I was generating a self-signed certificate on my development environment. Hopefully this will help you when you run into this issue.

If you are running into issues with 401 or 403 errors connecting to xConnnect then this article can help you troubleshooting the certificate issues. It is all about xConnect Security.

Monday, November 13, 2017

So here is the problem. I have a component where the user assigns a media folder for say a photo gallery. Now I simply want to pull in all images from beneath this folder. I was tempted to do this but it always returns null.

imageFolderItem.Children.OfType<Image>()

But why? Well according to Sitecore Poutine (Corey Smith AKA Sitecorey) the Image represents an Image field not the Sitecore Image template. So to accomplish this you would simply do the following:

Go to the definition of Image and copy the class. Make your own class but call it ImageItem.
Now set the TemplateId to be the Id of the Image template in Sitecore.

I wish I had found this article a couple hours ago so if you have written one on this issue and have a better description on what the issue is and how to solve it comment here. Hopefully this will help someone else with the issue.

Wednesday, November 8, 2017

Installing Sitecore 9

Now that you are back from Sitecore Symposium and the announcement has been made you are likely wanting to get started installing it. This article will help you get it set up and offer tips on places where you could run into issues.

WARNING: The focus of this blog on the local developer environment install and getting you started. If you are installing in any other environment you will want to follow a different set of instructions. If you need help with that let me know I would be glad to help personally or direct you to someone whom can help.

SPECIAL NOTE FOR Windows 8 or 10: If you have not already you will need to enable the Local Admin account. After you have done this you can create a local admin account for SOLR to run under as well as set up app pool users.

If you are new to SOLR, please be aware that SOLR is a Java technology so you will required to Install Java to run it. If after install SOLR will not start then you probably have to install Java. You can confirm this by opening a command prompt (Run as Administrator and then CD SOLR\solr-6.6.2\bin changing the version if you have a newer version of SOLR. Then type solr start. You will get the error saying:

error: java.exe not found

If java is installed and still get the error check the path in your environment variables JAVA_HOME. Mine was set to the wrong path, an older version of Java.

You can confirm SOLR is running by going to the admin https://solr:8983/solr if you changed your port then this may be different but if you stuck with the defaults it should show the SOLR admin

When I installed the first time, I unchecked the checkbox so it would run automatically but then ran into issues with permissions writing to the host file. A better approach is to set the permissions on the host file then open Windows Powershell SPE (Run as Administrator) then in the command window enter this command:

Set-ExecutionPolicy RemoteSigned

After that then run the generated script. This worked well for me. I have now copied Jeremy Davis' script along with Kam's to my R2D2 Unit for transport to any dev machine that needs it in the future.

Possible Issues and Troubleshooting

First Time Install

I mentioned a couple things inline in the install section but there are a few other things that may help you will resolving issues.

ISSUE: Error requesting

http://xp0.sc/sitecore/admin/PopulateManagedSchema.aspx?indexes=all: The remote server returned an error: (500)

POSSIBLE RESOLUTION: Check event log and in my case it said "Login failed for user 'collectionuser'. Reason: Could not find a login matching the name provided. [CLIENT: <local machine>]" Now in my case I had to add that user to my database and ensure it had access to the proper permissions. If you are using another user for the collection user then you need to edit the connectionstring.config however note that there are now 2 connectionstring.config files. The first in in App_Config but the other is in \App_data\jobs\continuous\IndexWorker\App_config\ConnectionStrings.config make sure you change both.

ISSUE: Error hitting xconnect in browser:

Handler "ExtensionlessUrlHandler-Integrated-4.0" has a bad module "ManagedPipelineHandler" in its module list

Now there is the normal spot in "Turn Windows Features On" for .NET 4.7 however there is also the other spot that is not as obvious place under "Turn Windows Features On" under "Internet Information Services > World Wide Web Services > Application Development Features" Navigate there and check ASP.NET 4.6

Re-Running The Install

Now if you ran the install and it failed, upon running it a second time you may run into other issues.
The first error you will get is:

You must remove all users with password before setting the containment property to NONE.

If you need help installing Sitecore 9 let us know and we will be glad to help out. I myself have only installed it in a local dev environment at this point but I am sure I will be doing it in a cloud capacity before you know it as well.

If you are looking for a mentor to connect with you on a regular basis for Sitecore or any other technology, Read Watch Create can arrange an introduction. Email me at chris.williams@readwatchcreate.com and I can arrange for mentoring sessions at a reasonable rates.