-
Notifications
You must be signed in to change notification settings - Fork 63
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
New project file format + Net Standard 2.0 build #139
Conversation
It looks like things worked once you set the paths to fsc.exe, but I was under the impression that this was no longer required, per the fsproj files in FSharp.Data: https://github.com/fsharp/FSharp.Data/blob/master/src/FSharp.Data/FSharp.Data.fsproj#L6 I'm not quite sure what's going on with that, but we should be able to build for net45 using the dotnet sdk only, right? |
I do still have ignored tests for ResX provider (the issue looks not related to TP).
Yes, you are right, I also did not use |
at least it works for Linux and macOS =) on windows, MSBuild cannot find assembly because of version mismatch of SharpYaml dependency ...
I am not sure how to pass binding redirect in this case ... Update: |
@baronfel Why |
That's a good question. To be honest I'm still very shaky on it, and we may want to get clarification from @dsyme, but I believe it's because on .net 45+ FSharp.Data provides a net45 TP Design-Time Component. I think the netstandard facade dll would be required if the TP only shipped a netstandard2.0 version of the Design-Time component, and then only in order to make the netstandard2.0 component run on .net461 and greater. |
|
||
nuget SharpYaml | ||
nuget FSharp.Core ~> 4.0.0 | ||
nuget YamlDotNet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vasily-kirichenko @object Do you any reason why we should not use YamlDotNet
and should keep SharpYaml
?
YamlDotNet.dll
is easier for net standard TP world, because it does not have external dependencies and should not resolve\redirect them...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the tests pass, I’m ok with yamldotnet.
First alpha with 2 TPs for |
I tried YamlConfig on Mac, the repo is https://github.com/vasily-kirichenko/ConsoleApp4 It work properly in Rider: but compilation fails: $ dotnet build
Microsoft (R) Build Engine version 15.6.82.30579 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Restoring packages for /Users/vaskir/RiderProjects/ConsoleApp4/ConsoleApp4/ConsoleApp4.fsproj...
Generating MSBuild file /Users/vaskir/RiderProjects/ConsoleApp4/ConsoleApp4/obj/ConsoleApp4.fsproj.nuget.g.props.
Restore completed in 192.34 ms for /Users/vaskir/RiderProjects/ConsoleApp4/ConsoleApp4/ConsoleApp4.fsproj.
error FS3053 : The type provider 'FSharp.Configuration.ConfigTypeProvider+FSharpConfigurationProvider' reported an error : The type provider constructor has thrown an exception: Exception has been thrown by the target of an invocation. [/Users/vaskir/RiderProjects/ConsoleApp4/ConsoleApp4/ConsoleApp4.fsproj]
FSC : warning FS3005: Referenced assembly '/Users/vaskir/.nuget/packages/fsharp.configuration/2.0.0-alpha1/lib/netstandard2.0/FSharp.Configuration.dll' has assembly level attribute 'Microsoft.FSharp.Core.CompilerServices.TypeProviderAssemblyAttribute' but no public type provider classes were found [/Users/vaskir/RiderProjects/ConsoleApp4/ConsoleApp4/ConsoleApp4.fsproj]
Build FAILED.
FSC : warning FS3005: Referenced assembly '/Users/vaskir/.nuget/packages/fsharp.configuration/2.0.0-alpha1/lib/netstandard2.0/FSharp.Configuration.dll' has assembly level attribute 'Microsoft.FSharp.Core.CompilerServices.TypeProviderAssemblyAttribute' but no public type provider classes were found [/Users/vaskir/RiderProjects/ConsoleApp4/ConsoleApp4/ConsoleApp4.fsproj]
error FS3053 : The type provider 'FSharp.Configuration.ConfigTypeProvider+FSharpConfigurationProvider' reported an error : The type provider constructor has thrown an exception: Exception has been thrown by the target of an invocation. [/Users/vaskir/RiderProjects/ConsoleApp4/ConsoleApp4/ConsoleApp4.fsproj]
1 Warning(s)
1 Error(s)
Time Elapsed 00:00:02.95 |
@vasily-kirichenko Yes.... one manual change required in <Project Sdk="Microsoft.NET.Sdk">
<Import Project="../../fsc.props" /> and
|
@sergey-tihon thanks, it works, but... Is it possible to add the props file into the nuget package and auto modify project file when it's installed? I know this is done by FSharp.Compiler.Tools, for example. |
@vasily-kirichenko hm... interesting idea. as I know other TPs do not do it yet... But what if you use several TPs NuGet packages and each import such
but SDK file is still pointing to
This probably means that path depends on VS version installed on the end-user machine... and there is no one file that covers all cases at the moment. We could try to invert one and release as a separate NuGet package and add the dependency from all type provider project, but I am not sure how long we need it. I want to believe that that very soon TPs will be able to run inside the .NET Core 2.0 hosted compiler... |
Finally had some time to test the new package (https://www.nuget.org/packages/FSharp.Configuration/2.0.0-alpha1). Built a project successfully both on Windows and Mac using either Visual Studio or Rider. Will have to run some runtime tests, but looks very promising so far. Great work guys! |
@baronfel Do you have an idea how Win build could be fixed? |
No, I was poking around locally this weekend a bit and didn't really get anywhere :( |
# Conflicts: # .github/workflows/dotnetcore.yml
# Conflicts: # src/FSharp.Configuration/TypeProviders.Helper.fs
When the list field is empty when updateList is called, the list is incorrectly inferred as sortable, as Seq.forall is vacuously true. To fix that, we check itemType using reflection instead. - ":? Uri" is done using Type.IsSubclass - ":? IComparable" uses Type.IsAssignable as IComparable is an interface
Any news here? I would like to use it in .NET core... |
@Slesa let's move our conversation from twitter here.
Yes, it is because it still build design time component for net46 Does 2.0.0-alpha3 works for you on .net core? |
Yes, works. Thanks a lot. |
# Conflicts: # .config/dotnet-tools.json # .github/workflows/dotnetcore.yml # build.fsx.lock # global.json # paket.lock # src/FSharp.Configuration.Runtime/paket.template
# Conflicts: # RELEASE_NOTES.md
Status
net45
Unit tests for ResX type provider temporary ignored because provided code failed to load actual value in runtime
Here should be some magic that fixes it when we build for full frameworks...
As of today .net core has the very limited support for resource files - dotnet/msbuild#2221
Status
netstandard2.0
TPs migrated to
netstandard2.0
:Tip for
YamlDotNet
serializer customization - https://www.cyotek.com/blog/using-custom-type-converters-with-csharp-and-yamldotnet-part-1