Created
June 28, 2012 23:22
-
-
Save dtchepak/3014681 to your computer and use it in GitHub Desktop.
[SOLVED] NSub error on mono when built with vs2012 tools
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Sorted, see https://gist.github.com/3014681#gistcomment-360816 | |
~/dev/git/mononsub % gmcs -sdk:4 Program.cs -reference:NSubstitute.dll | |
Missing method .ctor in assembly /Users/dave/dev/git/mononsub/NSubstitute.dll, type System.Runtime.Versioning.TargetFrameworkAttribute | |
Can't find custom attr constructor image: /Users/dave/dev/git/mononsub/NSubstitute.dll mtoken: 0x0a00085a | |
~/dev/git/mononsub % dmcs Program.cs -reference:newsub40/NSubstitute.dll | |
Missing method .ctor in assembly /Users/dtchepak/dev/git/mononsub/newsub40/NSubstitute.dll, type System.Runtime.CompilerServices.ExtensionAttribute | |
Can't find custom attr constructor image: /Users/dtchepak/dev/git/mononsub/newsub40/NSubstitute.dll mtoken: 0x0a000850 | |
-- No error when using NSubstitute.dll built via vs2010 tools. | |
-- Only happens with vs2012 tools, and in the DLL targeting net40 (the net35 one works ok). | |
-- Current nuget/github version is built w/vs2012 (http://nsubstitute.github.com/). | |
-- http://bit.ly/nsubbuilds latest is vs2010 tools (login as guest). | |
-- Program.cs | |
using System; | |
using NSubstitute; | |
public class Program { | |
public static void Main() { | |
var foo = Substitute.For<IFoo>(); | |
foo.Foo = "hello"; | |
Console.WriteLine(foo.Foo); | |
} | |
public interface IFoo { string Foo { get; set; }} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@dsplaisted Thanks!