Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8702189
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:35:27+00:00 2026-06-13T02:35:27+00:00

Using Visual Studio 2012 to generate stubs with Add Fakes Assembly, everything works as

  • 0

Using Visual Studio 2012 to generate stubs with “Add Fakes Assembly”, everything works as expected, except it is failing to generate a stub for this interface:

public interface IFileWrapper
{
    IEnumerable<string> ReadLines(string path);
    bool Exists(string path);
    Stream OpenReadStream(string path);
}

When I change the Stream to a FileStream (as Stream is an abstract class and I wanted to check if this is only happening with abstract classes), I am still not able to generate.
When I remove the method signature completely (that is deleting Stream OpenReadStream(string path);), I am able to generate the stub.

This is my .fake file content:

<Fakes xmlns="http://schemas.microsoft.com/fakes/2011/" Diagnostic="true" Verbosity="Noisy">
  <Assembly Name="System.IO.Abstractions"/>
  <StubGeneration>
    <Clear />
    <Add AbstractClasses="true"/>
    <Add Interfaces="true"/>
  </StubGeneration>
  <ShimGeneration>
    <Clear />
  </ShimGeneration>
</Fakes>
  1. Any idea why is this happening and how can I avoid it?
  2. There is supposed to be a Visual Studio output panel where the Fake generation results will display. I can’t see any and they are not displaying in the regular build panel. Any ideas where I can find it? I searched all VS 2012 menus.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T02:35:29+00:00Added an answer on June 13, 2026 at 2:35 am

    This is caused by a limitation in the Fakes’ current implementation. You can work around this problem by switching the target framework in your unit test project from 4.0 to 4.5.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using visual studio 2012 to generate XML from a T4 template. The top
How do I generate test data using Visual Studio 2012? I found these 2
Started using Visual Studio 2012 RC since yesterday, We have one WCF solution. Whenever
I'm using Visual Studio 2012 for Windows Phone 7 and this is my first
I am using Visual Studio Express 2012 RC. If a create a blank hello
I'm using SOAP through Visual Studio 2012 RC with C# to use the Magento
I am using Visual studio 2011 beta with the april 2012 update installed .I
I am currently developing on Visual Studio 2012 RC using TFS Preview for source
Using Visual Studio 2012, I'd like to create a C++ project folder called Include
I am using Visual Studio 2010 and I installed Microsoft Report Viewer 2012 Runtime

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.