fsprojects / FSharp.Data.WsdlProvider

An implementation of the WsdlProvider compatible with netfx and netcore
Other
24 stars 4 forks source link

Getting Error in Visual Studio Code #9

Closed toburger closed 4 years ago

toburger commented 4 years ago

Opening a project with FSharp.Data.WsdlProvider in Visual Studio Code I get the following error:

image

The code compiles and runs though.

thinkbeforecoding commented 4 years ago

This is strange, I don't get the same error running it in VS code both in windows and linux (running wsl2).

Could you provide a projet for a repro ?

Thank you.

toburger commented 4 years ago

Minimal repro: https://github.com/toburger/FSharp.Data.WsldProvider-MinimalRepro

Steps to reproduce:

I've disabled all Ionide settings customizations I've made and cleared all NuGet caches to be sure that the error comes from a corrupted NuGet package: dotnet nuget locals all --clear

error: The type provider 'C:\Users\Tobias\.nuget\packages\fsharp.data.wsdlprovider\0.5.0-alpha\lib\netstandard2.0\FSharp.Data.WsdlProvider.Runtime.dll' reported an error: The type provider designer assembly 'FSharp.Data.WsdlProvider.DesignTime.dll' could not be loaded from folder 'C:\Users\Tobias\.nuget\packages\fsharp.data.wsdlprovider\0.5.0-alpha\typeproviders\fsharp41\netcoreapp3.1'. The exception reported was: System.IO.FileNotFoundException - Could not load file or assembly 'System.Runtime, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.

warning: Referenced assembly 'C:\Users\Tobias\.nuget\packages\fsharp.data.wsdlprovider\0.5.0-alpha\lib\netstandard2.0\FSharp.Data.WsdlProvider.Runtime.dll' has assembly level attribute 'Microsoft.FSharp.Core.CompilerServices.TypeProviderAssemblyAttribute' but no public type provider classes were found

image

toburger commented 4 years ago

Okay, I'm surprised and confused... Running from WSL2 I get the following error: image

Searching for FSharp.Data.WsdlProvider on NuGet I cannot find the package?

So the question is why does this work under Windows and from where does it download the package!? 😲

toburger commented 4 years ago

Ah, it comes from here: https://www.myget.org/feed/wsdlprovider/package/nuget/FSharp.Data.WsdlProvider 😄

Okay, now I got it to work under WSL2 and the error seems Windows specific. I'm not getting the error under WSL2.

toburger commented 4 years ago

Maybe a badge in the readme would help to eliminate the confusion: MyGet Badge

thinkbeforecoding commented 4 years ago

I made a 0.6.0-alpha version with a better nuget packaging that should fix this. Can you tell me if it solves the problem on your side ?

toburger commented 4 years ago

I made a 0.6.0-alpha version with a better nuget packaging that should fix this.

👍

Can you tell me if it solves the problem on your side ?

Working with WSL2 IS the fix! 🤗 I tried SwaggerProvider and got the same error... So it is a problem on my local machine. Don't know the cause though...

Closing this issue as it has nothing to do with this library.

thinkbeforecoding commented 4 years ago

Cool. You should probably manage to get it running also in windows now anyway.