MisterJames / GenFu

GenFu is a library you can use to generate realistic test data. It is composed of several property fillers that can populate commonly named properties through reflection using an internal database of values or randomly created data. You can override any of the fillers, give GenFu hints on how to fill them.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Minimum .NET Standard Targets

clarkis117 opened this issue · comments

Following up on this previous issue from #91 and #92

After fiddling around with it a bit, the minimum targets I came up with for GenFu are:
.NET Standard 1.3
.NET Framework 4.5

.NET Standard 1.3 seems to be the lowest version that would allow it to build on .NET Core, with the System.Reflection.TypeExtensions package. Supposedly .NET Standard 1.0 to 1.2 should have feature parity with .NET 4.5; however, when using it large swaths of APIs seem inaccessible. In addition, System.Reflection.TypeExtensions only supports down to .NET Standard 1.3.

Other Notes:
After adding the System.Reflection.TypeExtensions package, I changed several calls to TypeInfo Methods since System.Reflection.TypeExtensions moves them back to the Type Class.

Also considering the recent patch to .NET Core (.NET Core 1.0.1), all .NET Core app model packages should be switched to 1.0.1. This shouldn’t affect platform targeting at all.

CC: @dpaquette @MisterJames
PR: #97

Don't know if this is the place to post this issue or if it would be better in AspNet Core/MVC repo, but I guess you will let me know it it is the case.

Since latest update to some packages (.NET Core 1.0.1), the template project comes with the following frameworks in project.json file:
"frameworks": { "netcoreapp1.0": { "imports": [ "dotnet5.6", "portable-net45+win8" ] } }

When compiling, we get the following error:
Package GenFu 1.1.1 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package GenFu 1.1.1 supports: - dnx451 (DNX,Version=v4.5.1) - dnxcore50 (DNXCore,Version=v5.0) - net45 (.NETFramework,Version=v4.5)

What would be the best fix, update GenFu compatible frameworks or change the default project.json file generated by VS2015?

Thanks in advance for your time (and your awesome videos)!

I don't really know how it all works with frameworks in project.json but according to this documentation https://docs.nuget.org/ndocs/schema/target-frameworks , the dnxcore50 is deprecated, so does that mean that it's GenFu package that should be updated to be declared as compatible with the new netcoreapp1.0 or something else should be done?

@os1r1s110 There's no reference to any of the dnx targets in the pull request. The pull request targets only "net45" and "netstandard1.3"; therefore, this should no longer be an issue.

"frameworks": { "netstandard1.3": { "dependencies": { "System.Reflection.TypeExtensions": "4.1.0" } }, "net45": {} }

So in your opinion I should only change the default project template to target dnxcore50?

No, that's not what I'm saying at all. I'm saying that having to have a target for dnxcore50, should no longer be required as switching GenFu to .NET Standard solves that issue. If you have any further issues with this, please file them as a separate issue and make sure to include your project.json and project.lock.json so it can be reproduced.

Ok I see, so it should work once your PR will get merged as if I understood correctly, defining dependency to netstandard 1.3 means that netcoreapp1.0 will automatically works as it includes all past netstandard versions all the way up to 1.6 right?

Source: https://docs.microsoft.com/en-us/dotnet/articles/standard/library

@clarkis117 thanks for your work here, this is merged and I'm prepping a release.