-
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
0.5.5 causes YamlProvider to throw on type initializer #76
Comments
I've unlisted 0.5.5 and 0.5.6 packages for now. |
Fixed with 23dcf73 |
This merely looks like a definitive rollback of nuget dependencies on SharpYaml (back to lib folder with unknown assembly sources). |
That's what they did yes, they did some debugging on slack but rolled it back for now because it broke for others, apparently the assembly needs to be in the same directory. |
We have three options here
|
Fix for dependencies in nuspec (#77) should have fixed it. In 0.5.5 nuget could not correctly add the dependency on SharpYaml. In 0.5.6, in should be OK (I checked nuspec in nupkg), so upgrading nuget should have add correct reference on SharpYaml. |
I'll re-open it for you guys to discuss further and decide on it. @pchalamet the fix did not fix it because the dll was in the wrong directory, very like this: http://bluemountaincapital.github.io/FSharpRProvider/devnotes.html
|
I will speculate but this looks like a "feature" in the F# type provider compiler infrastructure. I guess an assembly for a type provider is isolated when running type provider at compile time for security reason (and ignoring whatever is referenced to compile a project). Probably @dsyme could help on this :-) Anyway, merging everything in one assembly with ILMerge could help (and Fake supports this out of the box) - this would probably provide an acceptable workaround for type provider infrastructure and enable using latest version of SharpYaml. |
@pchalamet ILMerge can lead to issues in runtime, if you decide to use latest The best solution is to setup #78 propose changes very similar to your suggestion, just download latest version of |
When upgrading to
0.5.5
the following code gives errors in Visual Studio at editing time:type WebConfig = YamlConfig<"Web.yaml">
The error is:
The type provider 'FSharp.Configuration.ConfigTypeProvider+FSharpConfigurationProvider' reported an error: The type initializer for '<StartupCode$FSharp-Configuration>.$FSharp.Configuration.YamlConfigTypeProvider' threw an exception
The input is a simple:
Although we tried debugging this with @vasily-kirichenko on slack, it seems to work when manually doing it in the test project (verified this myself as well)
However, I have reproduced it by changing the test project to use 0.5.5 from NuGet and using the above configuration file.
You clone this: https://github.com/CumpsD/FSharp.Configuration and open
FSharp.Configuration.Tests.sln
. You should see inYamlProvider.Tests.fs
it gives errorsThe text was updated successfully, but these errors were encountered: