Missing the application name

  1. #1

    Missing the application name

    I created an example form Ext.Net.Template (Ext.Net.Classic 7.0)
    In 'launchSettings.json' file, I set
    { "applicationUrl": "http://localhost:5000"}
    start the web, it works well.
    But I set it with an appPath "/extnet7"
    { "applicationUrl": "http://localhost:5000/extnet7"}
    it not work, because it also generated the resource files(urls) as
    <link type="text/css" rel="stylesheet" href="/extnet/extjs/packages/theme-spotless/build/resources/theme-spotless-all.css"/>
    <script type="text/javascript" src="/extnet/extjs/ext-all.js"></script>
    <script type="text/javascript" src="/extnet/extnet/extnet-all.js"></script>
    Actually, they should be like these
    <link type="text/css" rel="stylesheet" href="/extnet7/extnet/extjs/packages/theme-spotless/build/resources/theme-spotless-all.css"/>
    <script type="text/javascript" src="/extnet7/extnet/extjs/ext-all.js"></script>
    <script type="text/javascript" src="/extnet7/extnet/extnet/extnet-all.js"></script>
    Also I deployed it on IIS, "Default Web Site" -> New application "extnet7"
    I visit http://localhost/extnet7/
    I got the same error.

    Click image for larger version. 

Name:	extnet7.jpg 
Views:	10 
Size:	27.1 KB 
ID:	25454

    Click image for larger version. 

Name:	ext.net7_2.jpg 
Views:	13 
Size:	21.7 KB 
ID:	25455
  2. #2
    Hi. Thanks for the report. We are investigating.
    Geoffrey McGill
    Founder
  3. #3
    Yep, there's an issue here.

    A fix might not be as straightforward as we initially thought.

    We are still working our way through some potential solutions and will post another update once we have a fix or workaround available.
    Last edited by geoffrey.mcgill; Oct 21, 2020 at 8:28 PM.
  4. #4
    Thank you so much.
  5. #5
    There is a defect in Ext.NET, but there is also an easy workaround that can be used until the fix becomes available.

    Please make the following revision within your projects Startup.cs file, inside in the Configure method.

    If you created a new app from the Ext.NET.Templates, you should see the following UseExtNetResources configuration block:

    app.UseExtNetResources(config =>
    {
        if (env.IsDevelopment())
        {
            config.UseDebug(true);
        }
    
        config.UseEmbedded();
        config.UseCharts();
        config.UseThemeSpotless();
    });
    Please change to the following:

    app.UseExtNetResources(config =>
    {
        config.UseEmbedded();
        config.UseCharts();
        config.UseThemeSpotless();
    });
    
    // Re-map the Ext.NET resources to a custom root path, 
    // and configure Debug/Rtl parameters
    app.UseExtNetResources("/extnet7/extnet", config =>
    {
        if (env.IsDevelopment())
        {
            config.UseDebug(true);
        }
    });
    This re-mapping of the resources should work for now.

    Once the fix is available in a future release, all you will require is to pass the path base. For example, the UseExtNetResources config would be:

    app.UseExtNetResources("/extnet7/extnet", config =>
    {
        if (env.IsDevelopment())
        {
            config.UseDebug(true);
        }
        config.UseEmbedded();
        config.UseCharts();
        config.UseThemeSpotless();
    });
    There is another workaround option where changing the Configure method signature to one where a runtime context is passed. For instance:

    public void Configure(IApplicationBuilder app, IWebHostEnvironment env, Ext.Net.Core.Execution.IExtRuntimeCtx extRuntime)
    {
        app.UseExtNetResources(config =>
        {
            config.UseEmbedded();
            config.UseThemeSpotless();
            config.UseCharts();
        });
    
        extRuntime.RequestRoot = "/extnet7/extnet";
    }
    If you are using Kestrel, you'll need to add a call to app.UsePathBase("/extnet7"); at the top of the Configure method.

    public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
    {
        app.UsePathBase("/extnet7");
    
        // all other existing configs below
    }
    Thanks for reporting the issue. It was an interesting one.

    Hope this helps.
    Geoffrey McGill
    Founder
  6. #6
    Hi, @geoffrey.mcgill, thank you for your help!
    I tested your code:
    1. app.UseExtNetResources("/extnet7/extnet", config =>
    {
    ...
    })
    it not work, the resource's path is mapped to the /extnet7/extnet7/extnet
    for example:
    http://localhost/extnet7/extnet/extjs/ext-all.js 404
    http://localhost/extnet7/extnet7/extnet/extjs/ext-all.js ok
    2. app.UsePathBase("/extnet7");
    it not work, the resource's path is mapped to the '/extnet7/extnet7/extnet7/extnet'
    for example:
    http://localhost/extnet7/extnet/extjs/ext-all.js 404
    http://localhost/extnet7/extnet7/extnet7/extnet/extjs/ext-all.js ok
    3. extRuntime.RequestRoot = "/extnet7/extnet";
    it works fine!
    http://localhost/extnet7/extnet/extjs/ext-all.js ok
    Thanks & Best regards
  7. #7
    We have fixed the issue and we can provide a patch release for testing if you email support@ext.net with the request.

    With the next release, no workaround is required and the original configuration will automatically detect the base path. If you have one of the workarounds above, it will have to be removed to use the next release (7.2.0).

    As of the next release (7.2.0), the original configuration will work as expected for the original scenario reported in this thread:

    app.UseExtNetResources(config =>{
        if (env.IsDevelopment())
        {
            config.UseDebug(true);
        }
    
        config.UseEmbedded();
        config.UseCharts();
        config.UseThemeSpotless();
    });
    Last edited by geoffrey.mcgill; Nov 03, 2020 at 3:11 PM.
  8. #8
    Good job! I'm looking forward to the next release.
    Thanks!

Similar Threads

  1. Replies: 4
    Last Post: Jan 05, 2017, 6:15 PM
  2. How to optimize application
    By kdms in forum 3.x Help
    Replies: 1
    Last Post: Mar 06, 2015, 5:59 PM
  3. FileSystemWatcher in MVC application
    By mhd in forum 2.x Help
    Replies: 5
    Last Post: Jul 24, 2014, 2:26 PM
  4. Desktop Application
    By xMAC in forum 1.x Help
    Replies: 4
    Last Post: Jun 25, 2012, 9:27 PM
  5. [CLOSED] Application Performance
    By Hari_CSC in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Mar 14, 2010, 7:11 PM

Tags for this Thread

Posting Permissions