Skip to content

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

@KevinRansom

Description

@KevinRansom

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Impact-Medium(Internal MS Team use only) Describes an issue with moderate impact on existing code.Regression

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions