Getting started, server-side blazor setting up

7 posts, 0 answers
  1. BitShift
    BitShift avatar
    168 posts
    Member since:
    Aug 2014

    Posted 30 Oct 2019 Link to this post

    Just updated to Telerik.UI.for.Blazor 2.2.1, but was having the problem before updating as well.  I suspect its just something Im missing.

     

    This section
    https://docs.telerik.com/blazor-ui/getting-started/server-blazor

    <head> . . . <script src="_content/telerik.ui.for.blazor/js/telerik-blazor.js" defer></script><!-- For Trial licenses use <script src="_content/telerik.ui.for.blazor.trial/js/telerik-blazor.js" defer></script> --></head>

     

    When I load my page, im getting 404 errors in the dev console for telerik-blazor.js.  I am adding dependencies to an existing Blazor project I started.
    We have the private nuget feed setup.  So that much looks right.  What am I missing? 

    This is in _Host.cshtml

    <app>
        @(await Html.RenderComponentAsync<App>(RenderMode.ServerPrerendered))
    </app>

     

    This is my MainLayout.cshtml

    @inherits LayoutComponentBase
     
    <TelerikRootComponent>
            <NavMenu />
            <div class="container-fluid">
                @Body
            </div>
    </TelerikRootComponent>
  2. BitShift
    BitShift avatar
    168 posts
    Member since:
    Aug 2014

    Posted 30 Oct 2019 Link to this post

    What is this _content folder, do I need to create that first?
  3. BitShift
    BitShift avatar
    168 posts
    Member since:
    Aug 2014

    Posted 30 Oct 2019 Link to this post

    Oh, forgot to mention that I made sure to follow along all the "setup" bits in this area, esp for static assets
    https://docs.telerik.com/blazor-ui/getting-started/what-you-need

    Somethings still not right

  4. BitShift
    BitShift avatar
    168 posts
    Member since:
    Aug 2014

    Posted 30 Oct 2019 Link to this post

    In the notes, I see this
    https://docs.telerik.com/blazor-ui/getting-started/what-you-need
    Static assets are automatically included in the solution by the Nuget package, so all that's needed is then to reference the asset:

    Which makes me wonder what this _content folder is

  5. BitShift
    BitShift avatar
    168 posts
    Member since:
    Aug 2014

    Posted 30 Oct 2019 Link to this post

    Well, silly me I think I skipped right past the very first thing.
    https://docs.telerik.com/blazor-ui/getting-started/what-you-need

    Make sure that you have .NET Core 3.1 Preview 1 and Visual Studio 2019 Preview installed.
    The latest version of Telerik UI for Blazor is 2.2.1 and it supports .NET Core 3.1 Preview 1.

     

    I only have the 3.0 release of .net core installed.  However, my questions still stand.
    - What is the "_content" folder mentioned in the example, is this created in the wwwroot folder when adding the nuget feed to the project? Or does one have to create it manually before adding the nuget feed?
    - I suppose its obvious, but I will ask - I guess I need to use the 3.1 preview of .net core

  6. BitShift
    BitShift avatar
    168 posts
    Member since:
    Aug 2014

    Posted 30 Oct 2019 Link to this post

    Ive updated my framework to 3.1 and still having an issue with loading the static resource telerik-blazor.js

    Here is what I see in my dev console with chrome. See attached file

     

  7. Marin Bratanov
    Admin
    Marin Bratanov avatar
    5351 posts

    Posted 31 Oct 2019 Link to this post

    Hi,

    To answer the two direct questions first:

    - What is the "_content" folder mentioned in the example, is this created in the wwwroot folder when adding the nuget feed to the project? Or does one have to create it manually before adding the nuget feed? - this is the folder that contains the static assets from the packages that the project references. This is where our JS Interop file resides, for example. The build process copies it from the local nuget package that is expanded into the local nuget cache into the project's target folder.
    - I suppose its obvious, but I will ask - I guess I need to use the 3.1 preview of .net core - yes. At the moment, .NET Core 3.1. Preview 1 is the latest and the only supported SDK.

     

    I am pasting here my answer to your ticket on the continued 404 of the static asset:

    This means that the build did not successfully copy the static assets from our NuGet package into the output folder of the problematic project. This is something that the framework does and we can't influence. The only suggestion I can make is to try the steps from this article: https://docs.telerik.com/blazor-ui/troubleshooting/js-errors. Assuming that the correct package is referenced (not the trial one) the only other hope is that cleaning the bin, obj and local cache folders may help.

    Of course, you can also use our CDN.

    Regards,
    Marin Bratanov
    Progress Telerik

     UI for Blazor

Back to Top