Git Product home page Git Product logo

Comments (13)

Tarmil avatar Tarmil commented on May 24, 2024 1

In this issue, they seem to have fixed their issue by updating NuGet packages. Checking the project in your archive, it seems indeed that Microsoft.AspNetCore.Components.WebAssembly v6.0.0 is still being referenced instead of v7.0.0. I got the project running by explicitly upgrading it in Client.fsproj:

        <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.0" />

It's quite annoying to have to do that explicitly though. I think it'll be better if I add the above line in the project template when I upgrade it to net7.0 (I'd rather not raise the requirement in the Bolero package itself).

from bolero.

Tarmil avatar Tarmil commented on May 24, 2024 1

There is now an explicit reference to Microsoft.AspNetCore.Components.WebAssembly 7.0.* in v0.21 of the project template.

from bolero.

Tarmil avatar Tarmil commented on May 24, 2024 1

Bolero 0.21.25 should now be working without an explicit dependency on Microsoft.AspNetCore.Components.WebAssembly.

from bolero.

BentTranberg avatar BentTranberg commented on May 24, 2024

Thank you. That finally solves it. Strange I didn't connect things, though I've been thinking about checking the assembly versions next.

I thought the system - dotnet that is - was better than this, in this area. I know there are shortcomings, but I can see now that most of AspNetCore assemblies are not version 7.0.0! I need a lot of explicit references for that. But System.* seems to be ok. I noticed yesterday that HtmlAgilityPack.dll is not the latest. Possibly also not FSharp.SystemTextJson.dll.

Maybe I need to consider using Paket after all, even though I feel it's such an incredible hassle.

from bolero.

Bananas-Are-Yellow avatar Bananas-Are-Yellow commented on May 24, 2024

There is one more thing to note. The sample produces this for the client project file:

<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="6.0.*" />

If you just change 6.0.* to be 7.0.* the problem still occurs. It seems that you also have to remove the .DevServer piece.

<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.*" />

Then it works.

from bolero.

Tarmil avatar Tarmil commented on May 24, 2024

That's odd, in my attempt on the TodoMVC project, I updated DevServer to 7.0.0 and it worked.

from bolero.

BentTranberg avatar BentTranberg commented on May 24, 2024

@Bananas-Are-Yellow, I don't understand your point.

If you "remove the .DevServer piece", you are no longer referencing Microsoft.AspNetCore.Components.WebAssembly.DevServer, but instead referencing Microsoft.AspNetCore.Components.WebAssembly, version 7.0.0, and that's exactly the solution @Tarmil suggested.

But the Microsoft.AspNetCore.Components.WebAssembly.DevServer is no longer brought in. The application still runs successfully, but I guess there's a reason the DevServer should be there.

from bolero.

BentTranberg avatar BentTranberg commented on May 24, 2024

Hmm... maybe I'm beginning to understand your point. I don't see a *.DevServer.dll when trying to get it back. Perhaps it's just a namespace in *.WebAssembly.dll ? Sorry, don't have time to figure this out now, but just thought I'd let you know how this ended here.

from bolero.

Bananas-Are-Yellow avatar Bananas-Are-Yellow commented on May 24, 2024

It seems that a package reference to Microsoft.AspNetCore.Components.WebAssembly is required to fix the import.data error in the browser console.

It also seems that Microsoft.AspNetCore.Components.WebAssembly.DevServer is not required for the HelloWorld client project (or for my own project), but it might be that it is required for certain server options that I do not have set.

So my conclusion is that both references should be present in the client project file.

(Remember to do a dotnet clean if you remove a package reference, otherwise, it is still present in the output folder, or at least that seems to be the case for me.)

from bolero.

Tarmil avatar Tarmil commented on May 24, 2024

DevServer isn't actually a package that adds any dll references; it contains msbuild scripting to run a client project directly with dotnet run. So you don't need it if you have a server project. Maybe we should make its inclusion in the project template conditional, and only add it with --server=false.

from bolero.

Bananas-Are-Yellow avatar Bananas-Are-Yellow commented on May 24, 2024

If I remove the explicit reference

<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.*" />

from the client project file, then the problem import.meta may only appear in a module is still there. Do I need to do something else?

from bolero.

Tarmil avatar Tarmil commented on May 24, 2024

Actually, I realize that I could make the dependency on Components.WebAssembly change based on the framework in the Bolero package itself. That would make things simpler than having to keep the right version in the project file.

from bolero.

Bananas-Are-Yellow avatar Bananas-Are-Yellow commented on May 24, 2024

Works now.
Thanks.

from bolero.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.