environment:
Windows 10, VS pro 2017 v 15.3.3,
Create a console application,
using nuget, I installed Splunk.Client v 2.2.0, which required System.Collections.Immutable v1.3.1
edit Program.c to have this:
static void Main(string[] args)
{ Read(); }
private static async void Read()
{
Service splunkService = await GetCloudService();
Job job = await splunkService.Jobs.CreateAsync("search index=* | head 10");
using (SearchResultStream stream = await job.GetSearchResultsAsync())
{ }
}
private static async Task<Service> GetCloudService()
{
Service splunkService = new Service(new Uri("https://localhost:8089"));
await splunkService.LogOnAsync("admin", "changeme");
return splunkService;
}
It complies, but it does not run, gets this error:
Description: An assembly (probably "Splunk.CLient") must be rewritten using the code contracts binary rewriter (CCRewrite) because it is calling Contract.Requires and the CONTRACTS_FULL symbol is defined.Remove any explicit definitions of the CONTRACTS_FULL symbol from your project and rebuild.
Do I really have to rebuild Splunk.Client? Is there another package I should be using? Any help will be greatly appreciated. I also tried with Splunk Client v2.2.7 and immutable v1.4.0 with the same results.
I tried to tag with Splunk.Client to no avail.
Thanks - Steve
... View more