Questions tagged [microsoft-contracts]

22 questions
1
vote
1 answer

Convert ImageSource into IRandomAccessStream

I have loaded image im my app with type ImageSource, and I want to share it, but I need to convert image to IRandomAccessStream. For e.g.: ImageSource _myLoadedImage; IRandomAccessStream ras; //Some code when _myLoadedImage convert to…
Viacheslav
  • 151
  • 1
  • 13
1
vote
1 answer

Can Microsoft.Contracts' static checker be used without Team System?

Aside from the requirement on Visual Studio Team System to be able to install Microsoft.Contacts with the static checker, is it possible to run the static checker without team system? Or, does it depend on an API exposed by studio's team system…
John Gietzen
  • 48,783
  • 32
  • 145
  • 190
1
vote
1 answer

Design by Contract: Can you have an Interface with a Protocol?

I'm pretty new to the concept of Design by Contract, but so far, I'm loving how easy it makes it to find potential bugs. However, I've been working with the Microsoft.Contracts library (which is pretty great,) and I have run into a road block. Take…
John Gietzen
  • 48,783
  • 32
  • 145
  • 190
1
vote
2 answers

CodeContracts: How to fulfill Require in Ctor using this() call?

I'm playing around with Microsoft's CodeContracts and encountered a problem I was unable to solve. I've got a class with two constructors: public Foo (public float f) { Contracts.Require(f > 0); } public Foo (int i) : this ((float)i) {} The…
mafu
  • 31,798
  • 42
  • 154
  • 247
1
vote
0 answers

Microsoft Contracts: Assembly load resulted in metadata import warning

I'm trying to learn my way around the Microsoft Code Contracts libraries, and I have the following simple function: internal static Engine CreateBuildEngine(Microsoft.Build.Framework.ILogger logger) { Contract.Requires( logger != null ); …
0
votes
1 answer

microsoft.contracts dll error when creating facebookclient object in facebook c#sdk

using Facebook; using Facebook.Web; public pageLoad() public void fetchFacebookData() { var fbApp = new FacebookClient();// error occured at this line var result = (IDictionary)fbApp.Get("me"); var name…
Anto Augustine
  • 165
  • 2
  • 5
  • 16
0
votes
1 answer

How do I set up Microsoft Contracts static checking in Visual Studio 2010?

I recently downloaded Visual Studio 2010b2, and wanted to re-evaluate some of my questions about the Microsoft contracts static checker. I managed to re-use most of the code by using the System.Diagnostics.Contracts namespace for the code, but I am…
John Gietzen
  • 48,783
  • 32
  • 145
  • 190
1
2