splunk / splunk-sdk-csharp-pcl

Splunk's next generation C# SDK
https://dev.splunk.com/enterprise/docs/csharp
Apache License 2.0
64 stars 46 forks source link

Avoid using the call to System.Diagnostics.Requires #79

Closed martinmine closed 6 years ago

martinmine commented 6 years ago

Newer versions of VS are having issues with CCRewrite and it turns out this is something that is going to die out in the future as Microsoft is reluctant on maintaining this. (see https://github.com/Microsoft/CodeContracts/issues/476)

This PR implements the System.Diagnostics.Requires functions in the Requires class. Since this is in the same namespace as the other classes, all the existing calls to System.Diagnostics.Requires are redirected to this implementation. As a result, the CCRewrite is no longer required to be installed on machines wanting to use this framework which simplifies development (and deployment) a lot. It also fixes the issue discussed on https://github.com/splunk/splunk-sdk-csharp-pcl/issues/42

shakeelmohamed commented 6 years ago

Thanks for your dedication in finding a fix for this @martinmine!