Skip to content
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

Type provider assembly error on TypeProviderAssemblyAttribute and FSharp.Core (netcoreapp2.2 + paket) #637

Open
aggieben opened this issue Sep 10, 2019 · 0 comments

Comments

@aggieben
Copy link

commented Sep 10, 2019

Description

I have failing builds as well as broken intellisense that appears to stem from the following issues:

The type provider 'C:\Users\ben\.nuget\packages\sqlprovider\1.1.66\lib\netstandard2.0\FSharp.Data.SqlProvider.dll' 
reported an error: Assembly attribute 'TypeProviderAssemblyAttribute' refers to a designer 
assembly 
'C:\Users\ben\.nuget\packages\sqlprovider\1.1.66\lib\netstandard2.0\FSharp.Data.SqlProvider.dll' 
which cannot be loaded or doesn't exist. Could not load file or assembly 
'FSharp.Core, Version=4.4.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one 
of its dependencies. The system cannot find the file specified. F# Compiler(3031)
Referenced assembly 'C:\Users\ben\.nuget\packages\sqlprovider\1.1.66\lib\netstandard2.0\FSharp.Data.SqlProvider.dll' 
has assembly level attribute 'Microsoft.FSharp.Core.CompilerServices.TypeProviderAssemblyAttribute' 
but no public type provider classes were found F# Compiler(3005)

Apologies for the odd formatting. Here's a screencap if that's easier:
image

The part of this that has my scratching my head the most is why FSharp.Core fails to load.

I created this project using forge, but it's just using modified CLI templates for new projects. My .fsproj:

<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.2</TargetFramework>
    <DebugType>portable</DebugType>
  </PropertyGroup>
  <ItemGroup>
    <Compile Include="Db.fs" />
    <Compile Include="Program.fs" />
    <None Include="App.config" />
  </ItemGroup>
  <Import Project="..\..\.paket\Paket.Restore.targets" />
</Project>

And my paket.dependencies:

source https://api.nuget.org/v3/index.json

framework: >= netstandard2.0
nuget FSharp.Core
nuget Npgsql
nuget SQLProvider

group Build
source https://www.nuget.org/api/v2

nuget FAKE

The versions reported in paket.lock for these dependencies are:
FSharp.Core: 4.7
Npgsql: 4.0.9
SQLProvider: 1.1.66

I'm using .NET Core 3.0 preview9:

C:\Users\ben\proj> dotnet --info
source https://api.nuget.org/v3/index.json

framework: >= netstandard2.0
nuget FSharp.Core
nuget Npgsql
nuget SQLProvider

group Build
source https://www.nuget.org/api/v2

nuget FAKE

Repro steps

Please provide the steps required to reproduce the problem

  1. Create new project with forge new, which creates empty projects with paket already configured

  2. add SQLProvider, Npgsql, and FSharp.Core to paket.dependencies

  3. paket install

  4. dotnet restore

  5. build or open in ionide-vs

Expected behavior

Type provider works, intellisense works

Actual behavior

Intellisense indicates build problems; dotnet build also indicates same top-level errrors

Known workarounds

Unsure. As best I understand it, recent SDKs (after 2.2?) supposedly don't require the .NET Core type provider workaround. (The issue dotnet/fsharp#3303 is marked obsolete)

Related information

  • Used database
    PostgreSQL

  • Operating system
    Windows 10

  • .NET Runtime, CoreCLR or Mono Version: 3.0-preview9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.