Closed pchalamet closed 11 months ago
This is done intentionally because you should not need SharpYaml.dll
in the end application. It is a design-time dependency. Type provider use it to read yaml file and provide types and your application should not have dependency on the library.
Do you have any issue because of the fact that library does not add to your app?
SharpYaml is not design time only dependency, it’s used to parse input when Load method is called at runtime.
Yes exactly - apps are crashing on parsing at runtime.
I tried to switch SharpYaml dependency from nuget to paket's github one. It works, but I'm not sure we solve any real problem with this approach. Thoughts?
You mean, just adding <files />
in nuspec ?
No. I mean removing SharpYaml nuget package dependency entirely and use Paket's github dependency, see https://github.com/fsprojects/FSharp.Configuration/compare/master...vasily-kirichenko:sharp-yaml-via-github-ref?expand=1
I think we can create our own shrunk SharpYaml C# project.
But couldn't we just run an ilmerge step instead ?
Yes.
ilmerge means that all users of FSharp.Configuration
will not be able to reference SharpYaml
from their projects
even if all types (of SharpYaml) are internalized ? SharpYaml is not exposed in the interface - must be fine.
I am not a big fan of using ilmerge for libraries that you distribute. It is great tool to pack all references inside your application, what will happen in runtime when user add a reference to a newer version of SharpYaml
and add assembly redirects?
@pchalamet I did release version 1.3.1
that pack SharpYaml.dll
inside. Could you please try it and check if it works for you?
Yes this works.
On the other hand, it's still a problem to ship assemblies from other packages. Asking myself if adding a dependency on SharpYaml would not be better while still leaving SharpYaml.dll in FSharp.Configuration (but without any reference nor file asset). There would still be discrepancies between Paket/NuGet and PackageReference thought. But it's up to you :-)
You can close the issue since it's now the same previous behavior. Thanks !
Description Nuspec is broken when using PackageReference. This can be observed when compiling project using PackageReference (instead of package.config or Paket) as SharpYaml.dll is missing from output.
Analysis Here is an excerpt from 1.3 nuspec:
SharpYaml.dll is available in lib folder of the package - but there is no reference, no runtime dependencies & no package reference to SharpYaml... which is pretty much a problem with PackageReference as it's picky about what is referenced vs what is copied.
All in all, with PackageReference, SharpYaml.dll never goes to output folder.
How to fix The build is using SharpYaml package - ideally the dependency shall be materialized in nuspec. But this was a tricky considering #77. Probably add a reference to SharpYaml.dll but won't play nice with other packages.