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

FSC : error FS0193: Could not find file 'c:\Users\kevinr\source\repos\Library2\Library2\tmpB4E3.dll #4795

Closed
KevinRansom opened this Issue Apr 27, 2018 · 24 comments

Comments

Projects
None yet
@KevinRansom
Contributor

KevinRansom commented Apr 27, 2018

When building a library built using the FSharp.Data.TypeProvider sql type providers fails with:

c:\Users\kevinr\source\repos\Library2\Library2>msbuild Library2.fsproj /v:minimal
Microsoft (R) Build Engine version 15.7.172.38367 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

FSC : error FS0193: Could not find file 'c:\Users\kevinr\source\repos\Library2\Library2\tmpCED1.dll'. [c:\Users\kevinr\source\repos\Library2\Library2\Library2.fsproj]

c:\Users\kevinr\source\repos\Library2\Library2>

Repro:

1.     Create an F# desktop Library project.
2.     Reference FSharp.Data.TypeProviders nuget package
3.     Create a sql database and table
4.     In the library project add code similar to:
module Mylib

open FSharp.Data.TypeProviders

// The database connection string
let [<Literal>] CONN = @"Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=MyLocalDatabase;Integrated Security=True"

// Connect to the database at compile-time
type SqlData1 = SqlDataConnection<CONN>

// Connect to the database at runtime
let ctxt = SqlData1.GetDataContext()

// Execute a query
let categories =
    query { for d in ctxt.MyTable1 do
            where (d.Column1 <> null)
            select (d.Column1, d.Column2, d.Column3, d.Column4 ) }


Example project file attached:  <you will need to point the connectionstring to point to a db on your sql server>
[Library2.zip](https://github.com/Microsoft/visualfsharp/files/1953711/Library2.zip)

When you build the project it fails with an error

@cartermp

This comment has been minimized.

Collaborator

cartermp commented Apr 27, 2018

FYI @dsyme we got a report of a case where the recent type provider change broke the usage of FSharp.Data.TypeProviders for .NET Framework projects

@abelbraaksma

This comment has been minimized.

Contributor

abelbraaksma commented Apr 27, 2018

Is this a bug against the nightly or a public release? The CsvProvider still works for me, but that's with the RTM.

@cartermp

This comment has been minimized.

Collaborator

cartermp commented Apr 27, 2018

Note: FSharp.Data.TypeProviders <> FSharp.Data

CsvProvider should work, especially since FSharp.Data has been updated to use the new Type Provider mechanisms. But I don't think FDT has seen any such update.

@dsyme

This comment has been minimized.

Contributor

dsyme commented Apr 27, 2018

This is either a regression in the compiler or a problem with the FSharp.Data.TypeProviders TP.

(Note: existing TPs should continue to work as before when using the compiler running with .NET Framework)

@KevinRansom

This comment has been minimized.

Contributor

KevinRansom commented Apr 27, 2018

It is a regression it was caused by this PR: #4629

@abelbraaksma it is in the VS2017.7 preview compiler,

@sir-wilhelm

This comment has been minimized.

sir-wilhelm commented May 7, 2018

I ran into the same FSC build error in my F# projects that reference FSharp.Data.TypeProvider after updating VS to 15.7.0.

@KevinRansom

This comment has been minimized.

Contributor

KevinRansom commented May 7, 2018

@sir-wilhelm

Yes the fix didn't make it into VS2017.7., it arrived too late.
It will be in VS2017.8.

Kevin

@davidoptima

This comment has been minimized.

davidoptima commented May 8, 2018

We use FSharp.Data.TypeProvider in a production project so after upgrading to 15.7 we cannot longer build and as it’s production we can’t use the preview compiler, so we are now having to downgrade to 15.6.7. Can this fix be put into the next minor bugfix release?

@cartermp

This comment has been minimized.

Collaborator

cartermp commented May 8, 2018

@davidoptima we'll do what we can to get this into a servicing release for 15.7. No guarantee when that will be at this time, largely because the release just went out and other teams are also collecting information about what to service.

@dsyme do you know if the latest FCT package has @KevinRansom's fix? If so, then @davidoptima and others can use it in the interim.

@fbehrens

This comment has been minimized.

fbehrens commented May 11, 2018

I have downgraded to 15.6.7 as well. @cartermp How will I know (when|which version) this fix has landed in Visual Studio ?

@cartermp

This comment has been minimized.

Collaborator

cartermp commented May 11, 2018

@fbehrens This should be in for 15.7.2, which is the next servicing update.

@brettfo

This comment has been minimized.

Member

brettfo commented May 11, 2018

As a follow up, I just merged the fix into the internal 15.7.2 branch. As to when that branch is finalized, built, and shipped, however, is way above my pay grade.

@demas

This comment has been minimized.

demas commented May 12, 2018

I have 15.8.0 Preview 1.1 installed with the same bug. Are this fix included in this release ?
Downgrading to 15.6.7 fixes the problem.

@cartermp

This comment has been minimized.

Collaborator

cartermp commented May 12, 2018

@demas this fix is in 15.7.2 only. Perhaps 15.8 Preview 2 will also have the fix, but we're not sure yet.

@brettfo

This comment has been minimized.

Member

brettfo commented May 14, 2018

15.8p2 should have this fix already in the pipeline.

@torbonde

This comment has been minimized.

torbonde commented May 17, 2018

Will this fix be available in the most recent nightly build, due to #4922 ?

@brettfo

This comment has been minimized.

Member

brettfo commented May 17, 2018

@torbonde Yes, it should. If you're not seeing it let us know.

@KevinRansom

This comment has been minimized.

Contributor

KevinRansom commented May 18, 2018

@torbonde the nightly doesn't ship with a compiler, However, . I believe it made it into the 15.7 release of VS. And so the latest update of the RTM visual studio should have it already.

@torbonde

This comment has been minimized.

torbonde commented May 18, 2018

@KevinRansom Ok, I thought that's what the PR I mentioned above changed, but maybe I have misunderstood. I had this issue with 15.7.1, which I suppose is the latest update so far.

@brettfo I tried the most recent nightly build, but wasn't actually able to load any F# projects (got an error on solution load), let alone build them. For now I'll downgrade to 15.6.7 and wait for the 15.7.2 update.

@cartermp

This comment has been minimized.

Collaborator

cartermp commented May 18, 2018

@torbonde I think @KevinRansom may have mistyped - the fix is not in the latest RTM release. It will be available in VS 15.7.2.

Solution load errors are a concern. Do you recall any error or have logs handy?

@torbonde

This comment has been minimized.

torbonde commented May 21, 2018

@cartermp Sure. I just installed the latest nightly build, to see if the error had magically been fixed. It hadn't.:)

I get the following error on solution load (copy/paste from activity log):

# Type Description GUID Hr Source Time (UTC)
1417   Begin package load [FSharpProjectPackage] {91A04A73-4F2C-4E7C-AD38-C1A68E7DA05C}   VisualStudio 2018/05/21 08:07:24.467
1418 ERROR LegacySitePackage failed for package [FSharpProjectPackage]Source: 'FSharp.ProjectSystem.FSharp' Description: Could not load file or assembly 'Microsoft.VisualStudio.LanguageServices, Version=2.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.LanguageServices, Version=2.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. File name: 'Microsoft.VisualStudio.LanguageServices, Version=2.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' at Microsoft.VisualStudio.FSharp.ProjectSystem.FSharpProjectPackage.Initialize() at Microsoft.VisualStudio.Shell.Package.Microsoft.VisualStudio.Shell.Interop.IVsPackage.SetSite(IServiceProvider sp) WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog]. {91A04A73-4F2C-4E7C-AD38-C1A68E7DA05C} 80070002 VisualStudio 2018/05/21 08:07:24.468
1419 ERROR SetSite failed for package FSharpProjectPackage {91A04A73-4F2C-4E7C-AD38-C1A68E7DA05C} 80070002 VisualStudio 2018/05/21 08:07:24.470
1420 ERROR End package load [FSharpProjectPackage] {91A04A73-4F2C-4E7C-AD38-C1A68E7DA05C} 80070002 VisualStudio 2018/05/21 08:07:24.472

The error below occurs when instantiating fsi:

# Type Description GUID Hr Source Time (UTC)
1517 ERROR Construction of frame content failed. Frame identifier: ST:0:0:{dee22b65-9761-4a26-8fb2-759b971d6dfc} Frame caption: F# Interactive Exception details: System.InvalidCastException: Specified cast is not valid. at Microsoft.VisualStudio.Shell.Interop.IVsShell5.LoadPackageWithContext(Guid& packageGuid, Int32 reason, Guid& context) at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.GetPackage() at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.ConstructContent()     VisualStudio 2018/05/21 08:07:27.249

I hope this helps. Otherwise, please let me know what I can do. Also, if this should be a separate issue, I'll create one.

@sir-wilhelm

This comment has been minimized.

sir-wilhelm commented May 22, 2018

Thanks for the updates, 157.2 resolved the issue for me.

@fbehrens

This comment has been minimized.

fbehrens commented May 23, 2018

updating to 15.7.2 resolves #4872 for me as well, thanks for all updates

@orient-man

This comment has been minimized.

orient-man commented May 28, 2018

updating to 15.7.2 didn't solve this issue for me. Here is repro project with WCF TypeProvider: https://github.com/orient-man/WcfTypeProviderNotWorking

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment