Closed DaveEmmerson closed 6 years ago
Aww... the AppVeyor build failed boo.
@DaveEmmerson thanks for taking a look at this, the existing code uses AppDomain.DefineDynamicAssembly which is supported in .Net 4.0. For .Net Core it looks like your trying to use AssemblyBuilder.DefineDynamicAssembly which requires .Net 4.5.
Foq currently produces assemblies for .Net 4.0 and .Net 4.5. I guess there's a number of things we could do here:
Yeah. Rookie mistake by me... didn't try on 4.0. I think netstandard 2.0 would be needed, which probably is equiv to 4.5. I'll check. Failing that, yeah, an ifdef could be a goer. Will give it a go and if it works locally (Inc 4.0!) will update the PR :)
On 11 Sep 2017 16:03, "Phillip Trelford" notifications@github.com wrote:
@DaveEmmerson https://github.com/daveemmerson thanks for taking a look at this, the existing code uses AppDomain.DefineDynamicAssembly https://msdn.microsoft.com/en-us/library/bs22fky4(v=vs.110).aspx which is supported in .Net 4.0. For .Net Core it looks like your trying to use AssemblyBuilder. DefineDynamicAssembly https://msdn.microsoft.com/en-us/library/hh737438(v=vs.110).aspx which requires .Net 4.5.
Foq currently produces assemblies for .Net 4.0 and .Net 4.5. I guess there's a number of things we could do here:
- only support .Net 4.5
- have a DotNetCore specific build with an #ifdef
- try and make it work with .Net Standard? (if that's ready?)
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/fsprojects/Foq/pull/20#issuecomment-328557995, or mute the thread https://github.com/notifications/unsubscribe-auth/ACP2dzIyrKwICEHz6qFXl37mm03sA33xks5shUuqgaJpZM4O8cIm .
Can this get closed?
Can do – I’ve not had a chance to look at it again. Wouldn’t want to suggest removing support for the older .NET versions just to get Core support as I don’t know who uses it, etc.
Sent from Mail for Windows 10
From: MatthiasSchuster Sent: 21 January 2018 11:28 To: fsprojects/Foq Cc: DaveEmmerson; Mention Subject: Re: [fsprojects/Foq] Replace AppDomain.CurrentDomain withAssemblyBuilder. (#20)
Can this get closed? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
Allows it to build on .Net Core 2.0
The VS2017 project still builds and the tests passed straight off (bar a few unrelated fails due to FSharp.Core versions).
I tried doing this on 1.1 back when I mentioned it, but that was a nightmare due to missing stuff. They've added loads back in 2.0. It just needed this one change to get it working in my project.
Seemed like a good idea to get it uploaded so it was known about, should anyone else want to do it. Won't be offended if you don't actually complete it ;)