5

I'm trying to write a desktop app that downloads all the errors for a specific app in my splunk(bugsense) account, I downloade their sample app but its giving me the following 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. CCRewrite can be downloaded from http://go.microsoft.com/fwlink/?LinkID=169180. After the rewriter is installed, it can be enabled in Visual Studio from the project's Properties page on the Code Contracts pane. Ensure that "Perform Runtime Contract Checking" is enabled, which will define CONTRACTS_FULL.

Also I can't find any decent/working example written in C# that uses splunk's REST-API to authenticate,get list of apps & their respective error-list.

Sample SDK Download Link; http://download.splunk.com/misc/sdk/csharp-pcl/splunk-sdk-csharp-pcl-2.2.3.zip

Any kind of help will be helpful.

Thanks.

KhanZeeshan
  • 1,410
  • 5
  • 23
  • 36
  • 1
    Read the [documentation](http://dev.splunk.com/view/csharp-sdk-pcl/SP-CAAAEYM)? `If you're using Visual Studio to develop with the SDK, you'll need to install the code contracts binary rewriter to build and run your projects and the SDK examples.` – Jesse Good Aug 11 '16 at 08:26
  • @JesseGood tried that too, still the same error, using this (https://visualstudiogallery.msdn.microsoft.com/1ec7db13-3363-46c9-851f-1ce455f66970) – KhanZeeshan Aug 11 '16 at 08:27
  • 1
    You have to turn Code Contracts on. Go to the Code Contract settings in Visual Studio under Project > Properties > Code Contracts and enable it. – Jesse Good Aug 11 '16 at 08:30
  • 2
    @JesseGood Thanks after installation I didn't restart the IDE, after doing that it worked Thanks. – KhanZeeshan Aug 11 '16 at 08:32
  • 1
    Case study how not to make an API: create nasty dependency on terribly documented 3rd party library that completely rewrites your binaries. I was forced to give up; I could never get the CC nuget package to do anything other than nuke my project. – dudeNumber4 Aug 07 '17 at 12:30

0 Answers0