fsprojects / FSharp.Configuration

The FSharp.Configuration project contains type providers for the configuration of .NET projects.
http://fsprojects.github.io/FSharp.Configuration/
Other
114 stars 63 forks source link

fsharp.configuration breaks sqlprovider #132

Closed avanmeul closed 6 years ago

avanmeul commented 6 years ago

In VS 2017 (.net 4.7), merely installing (without even using) FSharp.Configuration (via package manager console) into a project using SqlProvider will cause the (previously working) project to get errors saying "The application is in break mode". From that point on there is no antidote that I have been able to find; even removing FSharp.Configuration or attempting to uninstall it will not get rid of this error.

It seems the mere act of installing this type provider will corrupt something?!? The only workaround I could find was to create a new solution/project and not use FSharp.Configuration.

vasily-kirichenko commented 6 years ago

Is it a design time or runtime error? If you use Paket instead of bare nuget, does it fix the error?

avanmeul commented 6 years ago

It is a runtime error. Everything builds with no errors, but as soon as you try to run you get the dialog box popping up, and there are errors in the output pane and the error dialog box.

I haven’t tried Paket. I don’t see why Nuget would be the problem here.

From: Vasily Kirichenko [mailto:notifications@github.com] Sent: Tuesday, October 3, 2017 10:14 PM To: fsprojects/FSharp.Configuration FSharp.Configuration@noreply.github.com Cc: avanmeul vanmeule@roadrunner.com; Author author@noreply.github.com Subject: Re: [fsprojects/FSharp.Configuration] fsharp.configuration breaks sqlprovider (#132)

Is it a design time or runtime error? If you use Paket instead of bare nuget, does it fix the error?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/fsprojects/FSharp.Configuration/issues/132#issuecomment-334051813 , or mute the thread https://github.com/notifications/unsubscribe-auth/AQNl9uYrdMFmrfjftN_qPAVsdrb2ldRPks5soxQNgaJpZM4PtBqC . https://github.com/notifications/beacon/AQNl9tqLOM-0zTz1exlrS-gHjEgu_p-oks5soxQNgaJpZM4PtBqC.gif

vasily-kirichenko commented 6 years ago

Add assembly binding redirect for FSharp.Core into App,config

avanmeul commented 6 years ago

I already tried that before posting the issue. I took the binding redirects from another F# project and pasted them into the app.config of the problematic project. It didn’t work.

From: Vasily Kirichenko [mailto:notifications@github.com] Sent: Wednesday, October 4, 2017 8:11 AM To: fsprojects/FSharp.Configuration FSharp.Configuration@noreply.github.com Cc: avanmeul vanmeule@roadrunner.com; Author author@noreply.github.com Subject: Re: [fsprojects/FSharp.Configuration] fsharp.configuration breaks sqlprovider (#132)

Add assembly binding redirect for FSharp.Core into App,config

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/fsprojects/FSharp.Configuration/issues/132#issuecomment-334188091 , or mute the thread https://github.com/notifications/unsubscribe-auth/AQNl9nDTjMmBb25CDXh42OUsrKbmSdmbks5so5_sgaJpZM4PtBqC . https://github.com/notifications/beacon/AQNl9lS8jI24y-ZGb1b3fXhl9fPjTA-pks5so5_sgaJpZM4PtBqC.gif

sergey-tihon commented 6 years ago

Could you post here your package.config and runtime exception?

avanmeul commented 6 years ago

--Packages.config

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="FSharp.Configuration" version="1.3.1" targetFramework="net47" />
  <package id="FSharp.Core" version="4.0.0.1" targetFramework="net461" />
  <package id="SQLProvider" version="1.1.11" targetFramework="net47" />
  <package id="System.ValueTuple" version="4.3.0" targetFramework="net452" />
</packages>

--output pane during run (note: no errors showing in the error list)—

'fsharpTypeProviderExample.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'. Cannot find or open the PDB file.
'fsharpTypeProviderExample.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\travel\class\fsharpTypeProviderExample\fsharpTypeProviderExample\bin\Debug\fsharpTypeProviderExample.exe'. Symbols loaded.
'fsharpTypeProviderExample.exe' (CLR v4.0.30319: fsharpTypeProviderExample.exe): Loaded 'C:\travel\class\fsharpTypeProviderExample\fsharpTypeProviderExample\bin\Debug\FSharp.Configuration.dll'. Module was built without symbols.
An unhandled exception of type 'System.IO.FileLoadException' occurred in Unknown Module.
Could not load file or assembly 'FSharp.Core, Version=4.4.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
avanmeul commented 6 years ago

[paste didn't work, trying the missing paste again...]

--Packages.config—

<?xml version="1.0" encoding="utf-8"?>

avanmeul commented 6 years ago
<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="FSharp.Configuration" version="1.3.1" targetFramework="net47" />
  <package id="FSharp.Core" version="4.0.0.1" targetFramework="net461" />
  <package id="SQLProvider" version="1.1.11" targetFramework="net47" />
  <package id="System.ValueTuple" version="4.3.0" targetFramework="net452" />
</packages>
sergey-tihon commented 6 years ago

I did fix formatting in your comments.

as you see app cannot load FSharp.Core, Version=4.4.1.0 but in config you reference id="FSharp.Core" version="4.0.0.1". So, the solution is correct binding redirect (probably to Version=4.4.0.0)

Could you please show your app.config here?

avanmeul commented 6 years ago

Thanks for your help. This may have actually been a Nuget caused problem (based on an error message I got while trying to fix this problem that referenced Nuget). What I did to fix the problem was to remove all binding redirects, changed the FSharp.Core reference in packages to the latest-and-greatest (4.4.1), removed the errant FSharp.Core 4.0.0.1 from references, and added a reference to FSharp.Core 4.4.1.

Works great. Sorry for all the trouble.