fsprojects / ExcelProvider

This library is for the .NET platform implementing a Excel type provider.
http://fsprojects.github.io/ExcelProvider/
The Unlicense
141 stars 51 forks source link

Problems with FSharp.Core versioning when building with Build.cmd #43

Closed magnushammar closed 7 years ago

magnushammar commented 7 years ago

The Tests are failing because of FSharp.Core referencing and deployment issues.

After reading among other things the issue microsoft/visualfsharp#2399 and not finding a solution, I tried to go around the problem and upgraded the project to 4.4.1.0, but then...

Correlation is not causation but I have noticed that the only two versions of FSharp.Core that are installed in GAC is v4.0_4.3.1.0 and v4.0_4.4.0.0.

If I manually copy the FSharp.Core 4.4.1.0 the tests run fine of course.

sergey-tihon commented 7 years ago

According to https://fsharp.github.io/2015/04/18/fsharp-core-notes.html you should not rely on GAC in any situation and ship FSharp.Core.dll with application (test proj = application)

@magnushammar Please try code from PR branch, I've updated .net framework to net461 for tests, reference latest FSharp.Core from Nuget, updated NUnit and FsUnit to latest version.

F# 4.1 dll should not be in the GAC

magnushammar commented 7 years ago

It works like a charm with the PR branch and thank you for the link.

Aside from being new to F# I also am quite new to the .Net framework. Trying to figure out the different versions, locations, project formats etc make my head spin far more than F#

Anyway, thank you again!

sergey-tihon commented 7 years ago

You are welcome. The magic is in assembly redirects that I generated automatically using Paket

<dependentAssembly>
  <Paket>True</Paket>
  <assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
  <bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="4.4.1.0" />
</dependentAssembly>

this line tells .net runtime to return v4.4.1.0 to anyone who asks for FSharp.Core.

All other changes are just updates to latest version of libraries and tooling.

AkosLukacs commented 7 years ago

@sergey-tihon Tried the code in your pull request, but failed. Here is the summary:

Running build failed.
Error:
Building C:\Dev\git\ExcelProvider\ExcelProvider.sln failed with exitcode 1.

---------------------------------------------------------------------
Build Time Report
---------------------------------------------------------------------
Target         Duration
------         --------
Clean          00:00:00.0027614
AssemblyInfo   00:00:00.0368392
Build          Failure
Total:         00:00:00.9984879
---------------------------------------------------------------------
Status:        Failure
---------------------------------------------------------------------
---------------------------------------------------------------------
  1) Building C:\Dev\git\ExcelProvider\ExcelProvider.sln failed with exitcode 1.
  2) MSB4057: C:\Dev\git\ExcelProvider\src\ExcelProvider\ExcelProvider.fsproj(0,0): The target "Rebuild" does not exist in the project.
  3) MSB4057: C:\Dev\git\ExcelProvider\tests\ExcelProvider.Tests\ExcelProvider.Tests.fsproj(0,0): The target "Rebuild" does not exist in the project.
---------------------------------------------------------------------

msbuild version: Microsoft (R) Build Engine version 15.1.1012.6693 dotnet: v.1.1.0

sergey-tihon commented 7 years ago

@AkosLukacs Sorry, but I have no idea how to fix it =( As you see, build is green on both CI server and my local machine, so the error is somehow related to your local environment.

I saw error The target "Rebuild" does not exist in the project. before, but I have no idea what it the reason and how to fix it in a general way.

AkosLukacs commented 7 years ago

@sergey-tihon Thanks for the reply! For reference: just RTFM fsharp.org says Starting with Visual Studio 2017 Update 3, F# is an optional component. Simply select F# from the Individual Components tab and press Install. VS build tools reinstall solved my issue.

sergey-tihon commented 7 years ago

@AkosLukacs does it work for you finally?

AkosLukacs commented 7 years ago

Yes, thanks. Both from VS and command line.

On 23 Aug 2017 06:39, "Sergey Tihon" notifications@github.com wrote:

@AkosLukacs https://github.com/akoslukacs does it work for you finally?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/fsprojects/ExcelProvider/issues/43#issuecomment-324219012, or mute the thread https://github.com/notifications/unsubscribe-auth/AAziKyUKh--B_QcEKyAQR2ygxdmEsh1hks5sa6zygaJpZM4Nlcew .

sergey-tihon commented 7 years ago

I did merge PR with fix and close this issue