I am trying to use xConnect in a .NET Core application. So i started of by copy pasting the method from the documentation that does this.
I changed the Thumbprint to the Thumbprint of the certificate First.xconnect_client in the Personal tab in the certificate manager.
// Valid certificate thumbprints must be passed in
CertificateWebRequestHandlerModifierOptions options = CertificateWebRequestHandlerModifierOptions.Parse("StoreName=My;StoreLocation=LocalMachine;FindType=FindByThumbprint;FindValue=0b4967ff4e0243c84e6cefafc107058f42bb91d4");
I changed the paths in the 3 client creation lines to my xconnect installation (first.xconnect)
// This overload takes three client end points - collection, search, and configuration
var collectionClient = new CollectionWebApiClient(new Uri("https://first.xconnect/odata"), clientModifiers, new[] { certificateModifier });
var searchClient = new SearchWebApiClient(new Uri("https://first.xconnect/odata"), clientModifiers, new[] { certificateModifier });
var configurationClient = new ConfigurationWebApiClient(new Uri("https://first.xconnect/configuration"), clientModifiers, new[] { certificateModifier });
I added some code inside the using to check if i could actually write to xConnect.
Sadly on the 3rd non commented line of code i get an exception.
var certificateModifier = new CertificateWebRequestHandlerModifier(options);
System.IO.FileNotFoundException: 'Could not load file or assembly 'Sitecore.Framework.Conditions, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.'
I have however included Sitecore.Framework.Conditions.dll in my references.
I pulled this file from the xConnect installation bin folder.
Does any one know what i am doing wrong?
EDIT:
I have added these references:
- First.Model (this is my custom model)
- Sitecore.Framework.Conditions
- Sitecore.XConnect
- Sitecore.XConnect.Client
- Sitecore.XConnect.Collection.Model
- Sitecore.Xdb.Common.Web
- System.Interactive.Async.Providers
I have added these packages:
- Microsoft.AspNetCore.All
- Microsoft.EntityFrameworkCore
- Newtonsoft.Json
- System.Net.Http.Formatting.Extension