Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Cannot create service - must be rewritten using the code contracts binary rewriter #42

Closed
thnk2wn opened this issue Sep 29, 2015 · 41 comments
Labels

Comments

@thnk2wn
Copy link

thnk2wn commented Sep 29, 2015

When creating the service I get the following error popup in Visual Studio 2015 Enterprise:

"An Assembly (probably "Splunk.Client") must be rewritten using the code contracts binary rewriter (CCRewrite)...

And I cannot proceed.

Splunk.Client 2.2.0

@shakeelmohamed
Copy link
Contributor

Hi @thnk2wn,

Thanks for letting us know, we're currently working on this in the bugfix/code-contracts branch

@thnk2wn
Copy link
Author

thnk2wn commented Sep 29, 2015

Thanks, please let me know when I can try again!

@mtevenan-splunk
Copy link
Contributor

Hi Geoff,

The documentation covers this. Please verify you've followed all the instructions on dev.splunk.com/view/SP-CAAAEYMhttp://dev.splunk.com/view/SP-CAAAEYM, and then let us know if you're still having trouble.

Thanks,
Matt

Matt Tevenan
Sr. Technical Writer
Splunk Inc. | www.splunk.comhttp://www.splunk.com

On Sep 29, 2015, at 2:21 PM, Geoff Hudik <[email protected]mailto:[email protected]> wrote:

When creating the service I get the following error popup in Visual Studio 2015 Enterprise:

"An Assembly (probably "Splunk.Client") must be rewritten using the code contracts binary rewriter (CCRewrite)...

And I cannot proceed.

Splunk.Client 2.2.0


Reply to this email directly or view it on GitHubhttps://github.com//issues/42.

@thnk2wn
Copy link
Author

thnk2wn commented Sep 29, 2015

@mtevenan-splunk Thanks. It would probably be helpful to add a link to that page to the readme. I arrived at this repo via nuget, I wasn't aware of that dev page.

@thnk2wn
Copy link
Author

thnk2wn commented Sep 29, 2015

I installed that and checked Perform Runtime Contract Checking but still receive the error. Is there something additional I need to setup on the Code Contracts tab page?

code contracts

@glennblock
Copy link
Contributor

There shouldn't be, it just requires the rewriter. However, we're in the
process of updating the SDK and will re-release it in the next few days
without requiring you to have the rewriter.

On Tue, Sep 29, 2015 at 3:00 PM Geoff Hudik [email protected]
wrote:

I installed that and checked Perform Runtime Contract Checking but still
receive the error. Is there something additional I need to setup on the
Code Contracts tab page?

[image: code contracts]
https://cloud.githubusercontent.com/assets/120529/10179419/b3cf4872-66ba-11e5-96ac-4a9cbcea45cb.png


Reply to this email directly or view it on GitHub
#42 (comment)
.

@shakeelmohamed
Copy link
Contributor

Hi @thnk2wn, we've just released v2.2.1 addressing this! Thanks for the bug report

@shakeelmohamed
Copy link
Contributor

This is still an issue in the v2.2.1 nuget packages. We'll be investigating this some more next week, stay tuned

@glennblock
Copy link
Contributor

It looks like the issue is due to something on the MyGet end. We let MyGet
build our packages. We are looking into it. Thanks for your patience.
On Fri, Oct 2, 2015 at 6:55 PM Shakeel Mohamed [email protected]
wrote:

This is still an issue in the v2.2.1 nuget packages. We'll be
investigating this some more next week, stay tuned


Reply to this email directly or view it on GitHub
#42 (comment)
.

@shakeelmohamed
Copy link
Contributor

Hi @thnk2wn,

We've released v2.2.2 on nuget.
I've verified there are no code contracts errors when running a simple project in VS 2013 & 2015 with the latest nuget package.
Please test it out and let us know, thanks again for your patience!

@muratoflu
Copy link

I came across the same issue where I resolved by rebuilding the entire pcl
library solution in its seperate folder and use the binaries generated by
that. Seems like nuget binaries just dont work for some reason or another.
7 Eki 2015 03:34 tarihinde "Shakeel Mohamed" [email protected]
yazdı:

Hi @thnk2wn https://github.com/thnk2wn,

We've released v2.2.2 on nuget.
I've verified there are no code contracts errors when running a simple
project in VS 2013 & 2015.
Please test it out and let us know, thanks again for your patience!


Reply to this email directly or view it on GitHub
#42 (comment)
.

@shakeelmohamed
Copy link
Contributor

Hi @muratoflu,

Have you tried v2.2.2 from Nuget? It should be fixed in the latest version.

@reminvestor
Copy link

I am using the latest v2.2.2 from Nuget with VS 2013 and I still get this issue after installing code contracts.

@glennblock
Copy link
Contributor

Have you updated to the latest nuget client?
On Wed, Nov 18, 2015 at 10:26 AM Ryan Martin [email protected]
wrote:

I am using the latest v2.2.2 from Nuget with VS 2013 and I still get this
issue after installing code contracts.


Reply to this email directly or view it on GitHub
#42 (comment)
.

@EfrainGonzalezBC
Copy link

Have VS2015 Nuget v.2.2.2 and still have the same issue. R u guys in Splunk planning to work on this issue soon?

@shakeelmohamed
Copy link
Contributor

@EfrainGonzalezBC this should be fixed in later versions. Can you try v2.2.6?

@rahulisola
Copy link

rahulisola commented Jun 14, 2017

Hello all,
I have a weird issue here. Project works fine with the correct options chosen in Code Contracts with Splunk.Client 2.2.5. But when I update to 2.2.6, it fails with the error even when Code Contracts is selected. I go back to 2.2.5 and it works again (with same settings). Tried multiple times to confirm the issue is with that particular version.
If it helps, I'm using nuget for installing.

@shakeelmohamed
Copy link
Contributor

Thanks for the update @rahulisola

@rahulisola
Copy link

@shakeelmohamed No problem. Happy to help.
Feel free to reach out if you need any information from my side or any help in testing a fix.

@SaiSK88
Copy link

SaiSK88 commented Aug 16, 2017

@shakeelmohamed,

I am using VS 2017 and Splunk.Client 2.2.6 still I am getting "An Assembly (probably "Splunk.Client") must be rewritten using the code contracts binary rewriter (CCRewrite)".

Please suggest how this can be fixed?

Regards,
Sai

@Gammeldags
Copy link

Gammeldags commented Sep 4, 2017

Version 2.2.6 does not work, CCRewriter does not work with VS2017,
but version 2.2.5 does not make these problems for me in VS2017

@cidico
Copy link

cidico commented Jan 23, 2018

I'm having the same issue here with VS 2015 and 2017 using 2.2.6.
Even using the plugin for Code Contracts. Any tips on how to solve it?!
Thanks in advance...

image

@ThiloL
Copy link

ThiloL commented Feb 9, 2018

Hey splunk! Are you there.
Fix this CCRewrite stuff immediately.

@yeneryumlu
Copy link

Hi,
I have the same issue with VS2017 and version 2.2.6. Is there any solution for this issue?

@shakeelmohamed
Copy link
Contributor

Hey folks, we've been unable to re-produce the issue in house and that's the main reason we don't have a fix up yet. We're more than happy to accept a pull request if anyone can determine a fix

@yuriyzotov
Copy link

Have the same Issue on VS2017 and Splunk.Client 2.2.6
When you will able to fix it?
To reproduce just add your NUGET to the solution and see the error

@martinmine
Copy link
Contributor

martinmine commented Apr 13, 2018

Also seeing this on Splunk.Client 2.2.7 from NuGet.org (VS2017/.NET Framework 4.7.1). As a result, I have to use version 2.2.5 as suggested by @Gammeldags (ironically, their username means old in Norwegian) but this gives me warnings with the System.Collections.Immutable :(

@martinmine
Copy link
Contributor

@shakeelmohamed Could this be an issue in your build system? I have investigated this a bit and the only difference I can see which could have an impact is the build system being misconfigured. I will do some more investigation and get back on this.

@martinmine
Copy link
Contributor

People have been reporting issues with this in more modern build systems: microsoft/CodeContracts#476

@shakeelmohamed
Copy link
Contributor

shakeelmohamed commented Apr 13, 2018

Could this be an issue in your build system?

@martinmine It's certainly possible, but unfortunately we do not currently have the bandwidth to investigate this issue

@martinmine
Copy link
Contributor

@shakeelmohamed are you saying you don't have bandwidth to download a newer version of Visual Studio?

@shakeelmohamed
Copy link
Contributor

@martinmine As much as it pains me to admit it, yes

@rahulisola
Copy link

rahulisola commented Apr 16, 2018

@martinmine I had independently done similar changes as you have in your pull request and it seems to be working for me for basic searches and retrieval with Splunk version 7.0.2 (tested with both VS 2015 and 2017). Can someone from the Splunk team look into martinmine's edits, perform some more exhaustive tests if required and merge with the official package if everything is good?

@martinmine
Copy link
Contributor

@shakeelmohamed Damn, that is resource constrained. How about getting a VM in the cloud to run VS for you or something?

@poparosa
Copy link

I have uploaded working libraries to my GitHub repository. It can be found here:
https://github.com/poparosa/Splunk.Client

@martinmine
Copy link
Contributor

martinmine commented May 26, 2018

@poparosa you could also just use the code in the PR that I linked above (#79); your repo only contains the DLL files (why?).

@almostjulian
Copy link

This is a blocker for migrating our project to .NET Core (need a working library with both a recent Systems.Collections.Immutable and the Code Contract issue resolved). @shakeelmohamed if you don't have time to work on this issue yourself, can you at least merge #79 and release, we're no worse off at this point...

@shakeelmohamed
Copy link
Contributor

Hi all, we've merged #79 (huge thanks to @martinmine!). We will look at getting a release out next week, thank you for your patience.

@almostjulian
Copy link

almostjulian commented Sep 28, 2018

Hi all, it's been a while, but it looks like this is still broken. While System.Collections.Immutable has been updated to 1.3.1 in the .nuspec and package.config, Splunk.Client.csproj still has a reference to 1.1.37....

@almostjulian
Copy link

I've create PR #84 to correct the issue with S.C.I. please review and let me know if you see any issues with this.

@ncanumalla-splunk
Copy link
Contributor

This SDK is deprecated and no longer under active development.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests