Base solution for your next web application
Open Closed

.NET Core V4.1.4 Download - lib folder and contents missing #3491


User avatar
0
exlnt created

I just downloaded ASPNETZERO .Net Core 1.1, version 4.1.4 from ASPNETZERO. When I open and run the solution, the UI is not working at all, all the CSS/JS references are missing. The "lib" folder under the wwwroot folder is completely missing. I rechecked my ZIP file download and it does not contain that folder either. Is this normal? How do I get all the UI components into the lib folder? What do I need to copy from Metronic files?


20 Answer(s)
  • User Avatar
    0
    alirizaadiyahsi created

    Hi,

    which version did you download, Angular or JQuery?

  • User Avatar
    0
    exlnt created

    <cite>alirizaadiyahsi: </cite> Hi,

    which version did you download, Angular or JQuery?

    JQUERY MVC template

  • User Avatar
    0
    ribbo created

    Same issue with Angular in the Public site project. Some of the files look to be under "browser_components" but not all.

  • User Avatar
    0
    alirizaadiyahsi created

    Actually this is not normal. When we tested, we did not find that issue. Could you share some screenshoot from your visual studio solution explorer(not from ZIP, because, some of UI components restoring after opening project in visual studio)?

  • User Avatar
    0
    ribbo created

    This is from Web.Public in the Angular project

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @Ribbo,

    Can you try to restore bower packages using Visual Studio ? Visual Studio sometimes cannot restore bower packages.

    Just right click on Bower folder under Dependencies and click Restore Packages. If that does not work, closing & opening VS can help as well.

    Thanks.

  • User Avatar
    0
    ribbo created

    You are 100% right, I did not have Git installed on the machine and Bower was throwing an error due to this trying to restore. Once Git was installed Bower loaded all required components. I am sure its the same issue for the other person above.

    Thanks!

  • User Avatar
    0
    exlnt created

    <cite>Ribbo: </cite> You are 100% right, I did not have Git installed on the machine and Bower was throwing an error due to this trying to restore. Once Git was installed Bower loaded all required components. I am sure its the same issue for the other person above.

    Thanks!

    I do not use GIT for my source control. I am using TFS. Do I still need to use the same steps to resolve my issue?

  • User Avatar
    0
    alper created
    Support Team

    Bower requires node, npm and git.

    See how to install bower and what it requires

  • User Avatar
    0
    exlnt created

    <cite>alper: </cite> Bower requires node, npm and git.

    See how to install bower and what it requires

    Thanks! This tip: <a class="postlink" href="https://stackoverflow.com/a/43078816">https://stackoverflow.com/a/43078816</a>, fixed my issue! All packages are installed now.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Thanks @exlnt :)

  • User Avatar
    0
    exlnt created

    @Support Team

    Can you provide step by step guide on how to add new UI components into .NET Core solution? I know how to do it in the .NET5 MVC solution. How do I bring in additional Metronic UI components into the .NET Core solution? If you just list out the high level steps that should help.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    You have two options here.

    1. You can copy the library from mentronic files to solution and reference it in the page you are going to use. You can also include it in the bundleconfig.json if you are going to use this library in more than one page.

    2. You can install this library as a bower package. Open Dependencies of your MVC project in solution explorer. Right click on bower and select "Manage Bower Packages". Then find the library you are looking for in bower. It will install library files under lib folder. Then you can include it into your view just like in the step 1.

    Normally using step 2 is better but sometimes you cannot find some libraries in bower or the one in bower might not work with metronic. In those cases you can apply step 1.

    Thanks.

  • User Avatar
    0
    exlnt created

    Thanks!

    I cannot seem to make this work. I have tried the following steps.

    1. Copy metronic plugin folder to wwwroot/lib folder.
    2. Edited bundleconfig with new section named "EXNTCssBundle" and "ExlntJSBundle"
    {
        "outputFileName": "wwwroot/view-resources/Areas/Nursing/Views/EXLNT/_ExlntCustomCSSBundle.css",
        "inputFiles": [
          "wwwroot/lib/datatables/datatables.min.css",
          "wwwroot/lib/datatables/plugins/bootstrap/datatables.bootstrap.css"
        ]
      },
      {
        "outputFileName": "wwwroot/view-resources/Areas/Nursing/Views/EXLNT/_ExlntCustomJSBundle.js",
        "inputFiles": [
          "wwwroot/lib/datatables/datatables.min.js",
          "wwwroot/lib/datatables/plugins/bootstrap/datatables.bootstrap.js"
        ]
      }
    
    1. Updated the Area/Nursing/Views/Layout/_Layout cshtml file with links to the new Exlnt bundles.
    2. Run app, no error reported on chrome console and datatables plugin not working!
  • User Avatar
    0
    exlnt created

    I just added the script and css file references for the new plugin directly on my editmodal.cshtml and they still dont work! What am I missing here?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Can you share the lines you have added to _Layout cshtml ?

    Thanks.

  • User Avatar
    0
    exlnt created
    <environment names="Development">
    ....
    ....
    @*EXLNT*@
      <link rel="stylesheet" href="~/view-resources/Areas/Nursing/Views/EXLNT/_ExlntCustomCSSBundle.css" asp-append-version="true" />
    

    Then in the "scripts" section, just above all the "Abp" script entries, I added the lines shown below.

    <environment names="Development">
    ....
    ....
            @*EXLNT*@
            <script href="~/view-resources/Areas/Nursing/Views/EXLNT/_ExlntCustomJSBundle.js" asp-append-version="true"></script>
    

    I also added the "min" entries under the "staging, production" sections.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    You also need to include below script files to your cshtml file.

    "wwwroot/lib/datatables/datatables.min.js",
    "wwwroot/lib/datatables/plugins/bootstrap/datatables.bootstrap.js"
    

    As you can see here <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero-core/blob/dev/aspnet-core/src/MyCompanyName.AbpZeroTemplate.Web.Mvc/Areas/AppAreaName/Views/Layout/_Layout.cshtml#L141">https://github.com/aspnetzero/aspnet-ze ... shtml#L141</a>

    We add scirpt files one by one for development environment. We add bundled scripts for Production or Staging environments.

    Thanks.

  • User Avatar
    0
    exlnt created

    Yes I'm aware of that. I added the min file (js) file entries, into _ExlntCustomJSBundle.js, but still my plugins are not working.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @exlnt,

    If you see that those files are loaded via browser's network tab, I don't know what we can do about it. If it is loading properly, problem might be related to your usage of code.

    Thanks.