Here's my file/folder structure:
\
|
--RealLibrary\
| |
| --RealClass.cs
|
--SandboxFakesByHand\
|
--Fakes\
| |
| --RealLibrary.fakes
|
--Consumer.cs
The contents of RealClass.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RealLibrary
{
public class RealClass
{
public string Name { get; set; }
}
}
The contents of Consumer.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SandboxFakesByHand
{
public class Consumer
{
public static void Method()
{
var a = new RealLibrary.Fakes.ShimRealClass();
}
}
}
The contents of RealLibrary.fakes
<Fakes xmlns="http://schemas.microsoft.com/fakes/2011/">
<Assembly Name="RealLibrary"/>
</Fakes>
Here's what I tried from the Developer Command Prompt for VS2012 (Premium) (starting in \RealLibrary\
):
> csc /target:library RealClass.cs
> cd ..\SandboxFakesByHand
> csc /target:library Consumer.cs
The last one gives me an error of:
Microsoft (R) Visual C# Compiler version 4.0.30319.33440
for Microsoft (R) .NET Framework 4.5
Copyright (C) Microsoft Corporation. All rights reserved.
Consumer.cs(13,25): error CS0246: The type or namespace name 'RealLibrary' could
not be found (are you missing a using directive or an assembly
reference?)
What I need to do to compile the Consume.cs file by hand?