-
Notifications
You must be signed in to change notification settings - Fork 268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.NET Core support #197
.NET Core support #197
Conversation
… to test the code
@jasonwilliams200OK Thank you for the PR. We stuck with combining the .NET 4 build artifacts and the .NET Core ones into one NuGet package. We hope to sort it out soon. |
This is working on classic .NET 4.6 (NSubstitute 1.10) but not in .NET Core.
Exception:
|
That needs:
I can take care of the first one. When dotnet guys will make cli to msbuild-driven (which is actively work in progress), they will provide a conversion tool from project.json+xproj -> new kind of csproj. At which point we can switch back (like many other projects will). That is nothing more than describing the manifest in XML vs. JSON format. If you are ok with this, I can do the refactoring. You would only need to run |
…rnikitin/NSubstitute into Issue192_NetCore_Project
…ith .NET Core. For more details see: https://github.com/dotnet/corefx/issues/4544#issuecomment-230272419
@jirisykora83 Could you provide more details please. What type do you try to substitute? @jasonwilliams200OK it isn't that easy unfortunately. I tried to express the current msbuild csproj via project.json sometime ago but failed. We have ILMerge and there were other pitfalls I don't remember of. The best (or only viable option) is to script that procedure via FAKE. There's a working version alexandrnikitin#8 It lacks xml docs for .NET Core and proper nuspec. But it works at least. |
@alexandrnikitin Sorry i don't know why it is mis in my post. I try substitute |
FAKE build script
- Added netstandard1.5 as valid target - Skipped NETCORE_TARGETS for tasks that are currently incompatible (such as tests/tests against docs) - Documented build params in "-T" task - Hacked around with FAKE target dependencies to try to selectively build NET/dotnetcore projects based on targets. Had to add "soft dependencies" on Clean and Version to make sure that, if they are being run, they do so prior to build. See [1]. [1]: http://fsharp.github.io/FAKE/soft-dependencies.html
Amend FAKE build script
(DT: Record of Peter's commits got lost while merging #197. Cherry-picked one of many commits as a marker for these contributions.)
(DT: Record of Peter's commits got lost while merging #197. Cherry-picked one of many commits as a marker for these contributions.)
Hi everyone, This is all part of the 2.0.0.0-rc release. (It needs to be RC as we take a dependency on a pre-release Castle.Core.) Thanks to everyone who participated with feedback and test results. Thanks especially to @alexandrnikitin, without whom this release would not have happened. Also thanks to @jasonwilliams200OK for his valuable contributions to the .net core code and CI builds. Regards, |
I'm trying to use the 2.0.0.rc or 2.0.1rc via nuget but both of them at the moment give me the following warning regarding Castle.Core: warning NU1603: Castle.Core 4.0.0-beta001 depends on System.ComponentModel.TypeConverter (>= 4.0.1) but System.ComponentModel.TypeConverter 4.0.1 was not found. An approximate best match of System.ComponentModel.TypeConverter 4.1.0 was resolved Is this to be expected? or is there a better version / rc to play with? |
@dougajmcdonald The latest stable version is 3.1.0. It targets .NET Standard 1.3 and has all fixes. Please try to use it. |
@alexandrnikitin thanks for the pointer, I misread the dependencies in nuget. Compilation is all happy now |
This is another option how to get .NET Core support for #192. I prefer this one more comparing to #193. Approach is borrowed from Automapper project.
Class Library (Package)
project that targets .Net 4, 4.5 and Core which replaced originalNSubstitute.csproj
.TypeExtensions
underSystem.Reflection
namespace that handles all work with types.Castle.Core
assembly compiled against .NET Core based on .NET Core support for Castle.Core castleproject/Core#92Class Library (Package)
type of project. To solve that we need to introduce separate old type projects likeAutoMapper
does.TODO:
add ILMerge for .NET Core project (better to have it in build script)Feedback is appreciated.