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

"No public type provider classes found" error when using dotnet cli #145

Closed
sircuri opened this issue Sep 11, 2018 · 3 comments
Closed

"No public type provider classes found" error when using dotnet cli #145

sircuri opened this issue Sep 11, 2018 · 3 comments

Comments

@sircuri
Copy link

sircuri commented Sep 11, 2018

I'm trying to create an F# application using the YamlConfig type provider in the .NET Core 2.1 SDK.

The following error keeps popping up when building this solution using the dotnet CLI:

error FS3053 : The type provider 'FSharp.Configuration.ConfigTypeProvider+FSharpConfigurationProvider' reported an error : The type provider constructor has thrown an exception: Exception has been thrown by the target of an invocation. [/Staging.FSharp/DataVault.Staging.FSharp.fsproj]
FSC : warning FS3005: Referenced assembly '/root/.nuget/packages/fsharp.configuration/2.0.0-alpha2/lib/netstandard2.0/FSharp.Configuration.dll' has assembly level attribute 'Microsoft.FSharp.Core.CompilerServices.TypeProviderAssemblyAttribute' but no public type provider classes were found

A workaround on a windows machine is to use the MSBuild tool instead of the dotnet CLI. But building it on a Ubuntu machine with only .NET Core SDK installed is a different story. There is no MSBuild CLI.

I have tried to search for this issue, but I don't even understand where this issue is coming from. Is it the dotnet CLI, is it an YamlConfig type provider issue or something completely different? I'm not even sure if this is the right place to address this issue at all.
Hope somebody can shed some light on this annoying compile error.

Thanks

@sergey-tihon
Copy link
Member

sergey-tihon commented Sep 12, 2018 via email

@sircuri
Copy link
Author

sircuri commented Sep 12, 2018

@sergey-tihon Thank you for pointing that out. I had no idea what to search for, but this is indeed the issue I have!

@sircuri sircuri closed this as completed Sep 12, 2018
@MarneeDear
Copy link

Adding the fsc.props file will work, but the one linked above might not work for your environment. If you are running on a build server you probably installed the F# compiler and dotnet build tools using the Visual Studio Build Tools installer instead of a Visual Studio IDE installer. In that case you can add this PropertyGroup (check your VIsual Studio install for your environment's path)

<PropertyGroup Condition="'$(IsWindows)' == 'true' AND Exists('C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\IDE\CommonExtensions\Microsoft\FSharp\fsc.exe')">
    <FscToolPath>C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\IDE\CommonExtensions\Microsoft\FSharp</FscToolPath>
    <FscToolExe>fsc.exe</FscToolExe>
  </PropertyGroup>

This adds a check for the path to the FSC in the Visual Studio 2017 Build Tools.

C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\IDE\CommonExtensions\Microsoft\FSharp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants