fsbolero / Bolero

Bolero brings Blazor to F# developers with an easy to use Model-View-Update architecture, HTML combinators, hot reloaded templates, type-safe endpoints, advanced routing and remoting capabilities, and more.
https://fsbolero.io
Apache License 2.0
1.06k stars 53 forks source link

IntelliSense error : Expected msorlib to have a version number #273

Open BentTranberg opened 1 year ago

BentTranberg commented 1 year ago

Sometimes IntelliSense will become corrupted when I edit a Bolero client project, and I have to restart VS to fix it. The errors that IntelliSense reports just indicate to me that it has lost track of things and no longer understands the source code, except for this one error :

FS3033 : The type provider ‘Bolero.Templating.Template’ reported an error: Expected msorlib to have a version number

Note the name in the error message : msorlib

Looks like somebody misspelled mscorlib somewhere. I have not found that name in the source of Bolero. I report this in the hope it can be an easy way to find a possible problem.

Versions: VS 2022 - 17.3.5 (latest) .NET 6.0.9 Server:

    <PackageReference Include="Bolero.Server" Version="0.20.18" />
    <PackageReference Include="Bolero.HotReload.Server" Version="0.20.4" />
    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="6.0.9" />

Client:

    <PackageReference Include="Bolero" Version="0.20.18" />
    <PackageReference Include="Bolero.Build" Version="0.20.18" />
    <PackageReference Include="Bolero.HotReload" Version="0.20.4" />
    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="6.0.9" />
Tarmil commented 1 year ago

I found the misspelled msorlib in the type provider SDK.

No idea why it happens though. Do you have other references in your project besides Bolero and Blazor?

BentTranberg commented 1 year ago

Do you have other references in your project besides Bolero and Blazor?

No, that was a complete listing above.

I was working on a new Bolero project, reworking the starter project into what I wanted when this trouble happened over and over again. As far as I could register along the way, the trouble was pretty much always happening when I was changing holes in HTML template files.

The trouble was always that IntelliSense reported errors. (I use "warnings as errors".) The solution never failed to compile and run.

The trouble is likely to happen again, and I'll pay more attention, record more info, and see if I can possibly create a solid step-by-step repro. I do suspect it will just boil down to trouble outside of Bolero, with the F# type provider system, like so often before.

ZeroBomb commented 10 months ago

I occasionally have this issue as well, but like you, I don't have a great feel for a potential root cause.

The only hypothesis I have come up with so far is that my project is stored on a network drive, and that might cause some sort of problem with IntelliSense keeping track of file changes.

I am using VSCode on Linux with dotnet 7.

fwaris commented 10 months ago

I am trying to build a new typeprovider (nothing to do with bolero) and I see this type of an issue occasionally, also - mostly in Visual Studio not in VS Code.

I landed here while searching for this issue on the internet

My guess is that its to do with caching and the internals of the type provider code