Having an issue deploying to a virtual directory that is not the root of the website in IIS. When we deploy, the app renders fine by the service calls have the incorrect URL. Example:
Deploying site to: <a class="postlink" href="http://www.test.com/aspnetzero">http://www.test.com/aspnetzero</a>
When the site renders in the browser, the api calls are made to: <a class="postlink" href="http://www.test.com/api..">http://www.test.com/api..</a>.
Instead of: <a class="postlink" href="http://www.test.com/aspnetzero/api">http://www.test.com/aspnetzero/api</a>
Is there some configuration I can change to make it work? We've already changed web.config to contain:
"App": { "WebSiteRootAddress": "http://www.test.com/aspnetzero/" },
Thanks
2 Answer(s)
-
0
Well, I found a workaround but I'm not sure if it's the appropriate solution.
In the _Layout.cshtml file there is this code:
<script type="text/javascript"> @* This is used to get the application's root path from javascript. It's useful if you're running application in a virtual directory under IIS. *@ var abp = abp || {}; abp.appPath = '@ApplicationPath'; </script>
If I change it to:
<script type="text/javascript"> @* This is used to get the application's root path from javascript. It's useful if you're running application in a virtual directory under IIS. *@ var abp = abp || {}; abp.appPath = '@ApplicationPath' + 'aspnetzero/'; </script>
It works.
-
0
Hi,
Your solution is fine at the moment. As I see, this is not implemented yet, see <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/blob/master/src/Abp.AspNetCore/AspNetCore/Mvc/Views/AbpRazorPage.cs#L26">https://github.com/aspnetboilerplate/as ... age.cs#L26</a>.
We will try to do it soon,
Thanks.