Shims warning messages

Nirav Kamani picture Nirav Kamani · Jul 14, 2014 · Viewed 11.7k times · Source

I am having small application in which I used SHIMS.

So as you know it gives warning like "Warning 20 Some fakes could not be generated. For complete details, set Diagnostic attribute of the Fakes element in this file to 'true' and rebuild the project."

So as said in the warning I tried to set the Diagnostic flag to true.

So as specified I got all the list of warning.

The number of warnings are 1933 from "mscorlib.fakes" file.

So to solve it I just took a look of all the following links check it out.

http://msdn.microsoft.com/en-us/library/hh708916.aspx#bkmk_type_filtering

vs 2012: Shims compile

Suppressing Microsoft Fakes warnings

http://connect.microsoft.com/VisualStudio/feedback/details/848682/microsoft-fakes-not-creating-properties-in-a-shim-of-a-class-with-auto-generated-properties

and other stuff.

But still I am unable to figure out how to solve all this warnings.

I also want to know is there any way to Suppress this warnings.

So how can I remove all this warnings in right way? And is there any other way to suppress all this warnings?

Whenever I am adding

<ShimGeneration>
    <Clear/>
    // other tags like add and etc..
<ShimGeneration/>

I am getting lots of errors in project like you are missing assembly reference and others.

So what is the way to clear out all this warnings and the way to suppress all this warnings?

Answer

Abhishek Sankhat picture Abhishek Sankhat · Jul 15, 2014
<Fakes xmlns="http://schemas.microsoft.com/fakes/2011/" Diagnostic="true">
  <Assembly Name="mscorlib" Version="4.0.0.0"/>
  <StubGeneration>
    <Clear />
  </StubGeneration>
  <ShimGeneration>
    <Clear />
    <!-- Add or remove library or class --> 
  </ShimGeneration>
</Fakes>