Hi,
I have the application with version 7.0 running on an IIS virtual directory. I changed the appsettings.json so the "WebSiteRootAddress": "http://localhost:80/cpms/", also this files CPMS.Web.Mvc\Views\Account\Login.cshtml and CPMS.Web.Mvc\Areas\App\Views\Layout\Default_Layout.cshtml so they would use the directory \cpms. And updated the path in several CSS files. The application is working fine.
I tried to update to version 8.1, but can't make it to work on a virtual directory. I have changed the path in the Login.csthml, and the Layout.cshtml, but I'm getting errors when the application is trying to access de api's. It doen't use the directory \cpms.
I can't figure out where to update the application so the api's use the correct URL.
Thanks for any help you can provide.
5 Answer(s)
-
0
hi
As far as I know, the asp net core application does not support IIS virtual directories.
-
0
Hi @maliming,
Thanks for your reply. You're right, but I managed to make it work with your suggestions from this question. https://support.aspnetzero.com/QA/Questions/7243
It was working fine with version 7.0. But now it doesn't with version 8.1. What I found is that the abp.appPath doesn't get the directory in the new version.
This is with version 7.0:
And this with version 8.1:
So I was wondering what changed?
-
0
I'm trying to deploy to a sub application, same result.
-
0
hi
Many layout pages have the following code.
var abp = abp || {}; abp.appPath = '@ApplicationPath';
The ApplicationPath property may have change in net core 3.1.
Can you try to change ApplicationPath to your virtual directory path?
Or replace it with a new property(VirtualDirectoryApplicationPath).
egpublic abstract class MyAppRazorPage : AbpRazorPage { [RazorInject] public IAbpSession AbpSession { get; set; } protected MyAppRazorPage() { LocalizationSourceName = MyAppConsts.LocalizationSourceName; } public new string ApplicationPath { get { var appPath = Context.Request.PathBase.Value; if (appPath == null) { return "/"; } appPath = appPath.EnsureEndsWith('/'); return appPath; } } }
-
0
This issue is closed because of no recent activity. Please create a new issue if you are still having this problem.