PDA

View Full Version : EXT.net Classic V7 - IIS deployment issue



Geovision
Nov 09, 2020, 1:17 PM
Dear,

Please note that I am trying to deploy an EXT.NET Classic WEB Application (EXT.net 7.1) on IIS including a valid License key but with no success.

Steps Achieved:
1- Add the license key into appsettings.json file
2- Publish application into IIS Profile.
3- Install on application server the .NET Core 3.1.9.
4- then deploy the published Application into the application server.

the problem is in displaying the EXT components as per the screenshot below:

25459

in comparison within the original application deployed on local environment:

25460

Can you help me please.

Regards,

geoffrey.mcgill
Nov 09, 2020, 6:14 PM
Looks like it might be related to the following issue:

https://forums.ext.net/showthread.php?62998-Missing-the-application-name

The issue is fix and will be available in the next release of Ext.NET Classic.

As a temp work-around, you can try setting the custom root path in your production (non-localhost) build.

https://forums.ext.net/showthread.php?62998-Missing-the-application-name&p=286047&viewfull=1#post286047

Hope this helps.

Geovision
Nov 16, 2020, 7:01 AM
Dear,

Please note that the fix that you post later, it doesn't work for me.
please find below the Configure method in my startup.cs:



public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
app.UseLiveReload();
}
else
{
app.UseExceptionHandler("/Error");
}

app.UseResponseCompression();

// 2. Use Ext.NET resources
// To be added prior to app.UseStaticFiles()
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);
}
});


//app.UseExtNetResources("/extnet7/extnet", config =>
//{
// if (env.IsDevelopment())
// {
// config.UseDebug(true);
// }
//});

// 3. Enable Ext.NET localization [not required]
// If included, localization will be handled automatically
// based on client browser preferences
app.UseExtNetLocalization();

app.UseStaticFiles();
app.UseRouting();
app.UseAuthorization();

// 4. Ext.NET middleware
// To be added prior to app.UseEndpoints()
app.UseExtNet(config =>
{
config.Theme = ThemeKind.Spotless;
});

app.UseEndpoints(endpoints => endpoints.MapRazorPages());




thank you

fabricio.murta
Nov 16, 2020, 3:23 PM
Hello @Geovision!

Have you tried changing the block starting at line 26 to the following?



app.UseExtNetResources("/FFMSADMINTOOLMVC/extnet7", config =>
{
if (env.IsDevelopment())
{
config.UseDebug(true);
}
});


Hope this helps!

Geovision
Nov 17, 2020, 10:16 AM
Dear,

Please note that the problem is fixed.
by updating the code as per below:



app.UseExtNetResources("/ffmsadmintoolmvc/extnet", config =>
{
if (env.IsDevelopment())
{
config.UseDebug(true);
}
});



in other hand, after deployment all subpages added in MenuData.cs class are stopped :



public static List<NavItem> Items = new List<NavItem>
{
new NavItem("Dashboard", "/", "dashboard"),
new NavItem("DirectEvent", "/directevent/", "flash_on"),
new NavItem("GridPanel", "/gridpanel/", "grid_on")

};


I noticed that, we need to add also a prefix as same as added in Startup.cs page as per the below:




public static List<NavItem> Items = new List<NavItem>
{
new NavItem("Dashboard", "/ffmsadmintoolmvc/", "dashboard"),
new NavItem("DirectEvent", "/ffmsadmintoolmvc/directevent/", "flash_on"),
new NavItem("GridPanel", "/ffmsadmintoolmvc/gridpanel/", "grid_on")

};




my question, is their another solution to avoid the case adding prefixes based on deployment path since the project can be deployed on multiple servers with different paths?

Regards,

geoffrey.mcgill
Nov 17, 2020, 10:24 AM
Can you try adding the following path with the ~ application root relative path instead?


// Existing
new NavItem("Dashboard", "/", "dashboard"),

// Revised
new NavItem("Dashboard", "~/", "dashboard"),

Geovision
Nov 17, 2020, 2:53 PM
Hello,

I tried also but with no success.

Regards,

fabricio.murta
Nov 17, 2020, 9:06 PM
Hello @Geovision!

Can you tell us what you configure on your web server to prepend that /ffmsadmintoolmvc path to your published website?

I would expect the ~/ substitution to work but if it doesn't, there is most likely a way to get that path as it will always be / on localhost and /ffmsadmintoolmvc/ in production. I just need to know what is that setting name so I can research how we can programmaticaly get that value so that the website works on both local and different public hosting environments.

Are you, maybe, using a public hosting company to host your website, or doing that straight from your own Windows Server?

geoffrey.mcgill
Nov 17, 2020, 9:22 PM
In _Navigation.cshtml, replace the <a> tag with the following @Url.Content(...) call:


// Old
<a href="@item.Path" class="@(cls)">

// New
<a href="@Url.Content(item.Path)" class="@(cls)">

And you would still require the ~/ prefix as suggested above (https://forums.ext.net/showthread.php?63016-EXT-net-Classic-V7-IIS-deployment-issue&p=286156&viewfull=1#post286156).

The paths used to build those html navigation links are not controlled by Ext.NET, so you would just need to resolve using whatever ASP.NET technique you prefer.

Hope this helps.

Geovision
Nov 20, 2020, 9:19 AM
Hello,

I tried all the above suggestions and it doesn't work for me.

Regards,

geoffrey.mcgill
Nov 21, 2020, 6:03 PM
I tried all the above suggestions and it doesn't work for me.

Thanks for the update.

As mentioned above, those links in the sidebar menu are not managed by Ext.NET or Ext.NET components, so you can just use whatever technique you prefer. Any page linking or routing technique that is used in a regular non-Ext.NET Razor Pages web application should work the same for those navigation links.

Geovision
Nov 23, 2020, 7:00 AM
Thank you, will use one of the mentioned techniques.

Regards,