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

openapitypeprovider\1.5.1\lib\netstandard2.0\OpenAPITypeProvider.dll cannot be loaded #6

Closed
ctaggart opened this issue Oct 10, 2018 · 10 comments

Comments

@ctaggart
Copy link

I'm a bit confused why I'm getting this TypeProvider error. I've got the latest Visual Studio 15.8.7 installed.

Severity Code Description Project File Line Suppression State
Error FS3031 The type provider 'C:\Users\taggac.nuget\packages\openapitypeprovider\1.5.1\lib\netstandard2.0\OpenAPITypeProvider.dll' reported an error: Assembly attribute 'TypeProviderAssemblyAttribute' refers to a designer assembly 'C:\Users\taggac.nuget\packages\openapitypeprovider\1.5.1\lib\netstandard2.0\OpenAPITypeProvider.dll' which cannot be loaded or doesn't exist. Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified. RegisterDeadboltClients C:\Users\taggac\coreservices\RegisterDeadboltClients\FSC 1 Active

image

@ctaggart
Copy link
Author

ctaggart commented Oct 11, 2018

dotnet build works. I wish F# type providers worked on dotnet core during design time in an editor. Here is the error from Ionide:

image

My fsproj is:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.1</TargetFramework>
  </PropertyGroup>
  <ItemGroup>
    <Compile Include="Program.fs" />
  </ItemGroup>
  <ItemGroup>
    <PackageReference Update="FSharp.Core" Version="4.5.2" />
    <PackageReference Include="OpenAPITypeProvider" Version="1.5.0" />
  </ItemGroup>
</Project>

@ctaggart
Copy link
Author

F# Type Provider Design-Time Components appears to still have troubles with dotnet core. Here are my notes from looking around:

Currently, host tools look for TPDTC DLLs alongside the TPRTC DLL.
However, today, for a TPDTC to be .NET Standard 2.0, it must be loadable into host tools using .NET Framework 4.6.1 or Mono 5.x, the most common platforms for execution of F# tooling. Because .NET Framework 4.6.1 doesn't fully support .NET Standard 2.0, this can only be done if the TPDTC ships alongside some facade DLLs. Currently the following facade DLLs are needed alongside the TPDTC:
https://github.com/fsprojects/FSharp.TypeProviders.SDK#making-a-net-standard-20-tpdtc

F# Tooling RFC FST-1003 - Loading Type Provider Design-Time Components into F# Tooling
https://github.com/fsharp/fslang-design/blob/master/tooling/FST-1003-loading-type-provider-design-time-components.md

I think there are still unresolved problems dotnet/fsharp#3303 (comment)

@Dzoukr
Copy link
Collaborator

Dzoukr commented Oct 11, 2018

Hi @ctaggart,

thanks for information and notes. I suppose that this example app does not work for you neither, does it?

https://github.com/fsprojects/OpenAPITypeProvider/tree/master/examples/NetCoreConsoleApp

@dsyme
Copy link

dsyme commented Oct 11, 2018

If you author type providers with dependencies you should use the exact structure used by the TPSDK template

dotnet new -i FSharp.TypeProviders.Templates
dotnet new typeprovider -n LemonadeProvider -lang F#
  1. this has separate TPDTC and TPRTC
  2. the nuget package is laid out correctly, including placing dependencies of the TPDTC into the TPDTC folder in the nuget
  3. The magic flag is passed to allow dependency loading here https://github.com/fsprojects/FSharp.TypeProviders.SDK/blob/master/templates/content/basic/src/MyProvider.DesignTime/MyProvider.DesignTime.fs#L20

@Dzoukr
Copy link
Collaborator

Dzoukr commented Oct 11, 2018

Thank you Don, I'll use template and try to merge it with current implementation.

@Dzoukr
Copy link
Collaborator

Dzoukr commented Oct 12, 2018

@ctaggart FYI I still working on it, I got build already running, but fighting with The design-time type 'OpenAPITypeProvider.ObjectValue' utilized by a type provider was not found in the target reference assembly set error. I am close to fix it, will publish new version with fix probably tonight.

@Dzoukr
Copy link
Collaborator

Dzoukr commented Oct 12, 2018

Hi @ctaggart, please, could you try this version and let me know?

https://www.nuget.org/packages/OpenAPITypeProvider/1.6.0-beta1

It's based on template mentioned by @dsyme and should hopefully fix all problems with dependencies. 🙏

@ctaggart
Copy link
Author

Yay! It is working now. 🎉

@Dzoukr
Copy link
Collaborator

Dzoukr commented Oct 12, 2018

Thanks @ctaggart! Going to release new full version soon, meanwhile stick with beta. Thanks!

@ctaggart
Copy link
Author

Enjoy your weekend @Dzoukr! I'll be back on Tuesday. This looks like a great start.

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